1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

vp9: initialize color space and range properties

This commit is contained in:
Vittorio Giovara 2014-10-05 22:58:50 +01:00
parent 65875a8b3b
commit eddf95283f

View File

@ -1040,6 +1040,18 @@ static int vp9_decode_frame(AVCodecContext *avctx, AVFrame *frame,
s->cur_frame->pict_type = s->keyframe ? AV_PICTURE_TYPE_I
: AV_PICTURE_TYPE_P;
if (s->fullrange)
avctx->color_range = AVCOL_RANGE_JPEG;
else
avctx->color_range = AVCOL_RANGE_MPEG;
switch (s->colorspace) {
case 1: avctx->colorspace = AVCOL_SPC_BT470BG; break;
case 2: avctx->colorspace = AVCOL_SPC_BT709; break;
case 3: avctx->colorspace = AVCOL_SPC_SMPTE170M; break;
case 4: avctx->colorspace = AVCOL_SPC_SMPTE240M; break;
}
// main tile decode loop
memset(s->above_partition_ctx, 0, s->cols);
memset(s->above_skip_ctx, 0, s->cols);