vpx: Support color range

The range field has been introduced in version 1.6.0
This commit is contained in:
Luca Barbato 2016-07-22 09:33:04 +02:00
parent ad71d3276f
commit b183abfb5b
2 changed files with 20 additions and 0 deletions

View file

@ -552,6 +552,16 @@ static int vp8_encode(AVCodecContext *avctx, AVPacket *pkt,
rawimg->stride[VPX_PLANE_U] = frame->linesize[1];
rawimg->stride[VPX_PLANE_V] = frame->linesize[2];
timestamp = frame->pts;
#if VPX_IMAGE_ABI_VERSION >= 4
switch (frame->color_range) {
case AVCOL_RANGE_MPEG:
rawimg->range = VPX_CR_STUDIO_RANGE;
break;
case AVCOL_RANGE_JPEG:
rawimg->range = VPX_CR_FULL_RANGE;
break;
}
#endif
if (frame->pict_type == AV_PICTURE_TYPE_I)
flags |= VPX_EFLAG_FORCE_KF;
}