mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-08 06:09:50 +00: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
2 changed files with 20 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue