mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-29 22:00:58 +02:00
vpx: Support color range
The range field has been introduced in version 1.6.0
This commit is contained in:
parent
ad71d3276f
commit
b183abfb5b
@ -99,6 +99,16 @@ static int vp8_decode(AVCodecContext *avctx,
|
||||
return ret;
|
||||
av_image_copy(picture->data, picture->linesize, img->planes,
|
||||
img->stride, avctx->pix_fmt, img->d_w, img->d_h);
|
||||
#if VPX_IMAGE_ABI_VERSION >= 4
|
||||
switch (img->range) {
|
||||
case VPX_CR_STUDIO_RANGE:
|
||||
picture->color_range = AVCOL_RANGE_MPEG;
|
||||
break;
|
||||
case VPX_CR_FULL_RANGE:
|
||||
picture->color_range = AVCOL_RANGE_JPEG;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
*got_frame = 1;
|
||||
}
|
||||
return avpkt->size;
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user