Browse Source

pngdec: set correct range

AV_PIX_FMT_GRAY8/16 are considered YUV formats, and the color_range is
not set - so the API user will have to assume limitted range. (Unless
the API user adds a special-case for the PNG decoder.)

Just export the correct range - full range.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.7
wm4 Michael Niedermayer 10 years ago
parent
commit
72e7553125
3 changed files with 4 additions and 2 deletions
  1. +2
    -0
      libavcodec/pngdec.c
  2. +1
    -1
      tests/ref/fate/png-ya16
  3. +1
    -1
      tests/ref/fate/png-ya8

+ 2
- 0
libavcodec/pngdec.c View File

@@ -633,6 +633,8 @@ static int decode_idat_chunk(AVCodecContext *avctx, PNGDecContext *s,
return AVERROR_INVALIDDATA;
}

avctx->color_range = AVCOL_RANGE_JPEG;

if ((ret = ff_thread_get_buffer(avctx, &s->picture, AV_GET_BUFFER_FLAG_REF)) < 0)
return ret;
ff_thread_finish_setup(avctx);


+ 1
- 1
tests/ref/fate/png-ya16 View File

@@ -1,2 +1,2 @@
#tb 0: 1/25
0, 0, 0, 1, 49152, 0x93ce1cd5
0, 0, 0, 1, 49152, 0x0801ce78

+ 1
- 1
tests/ref/fate/png-ya8 View File

@@ -1,2 +1,2 @@
#tb 0: 1/25
0, 0, 0, 1, 49152, 0xed73bf03
0, 0, 0, 1, 49152, 0x5a1481f8

Loading…
Cancel
Save