diff options
author | Clément Bœsch <cboesch@gopro.com> | 2017-03-15 14:23:18 +0300 |
---|---|---|
committer | Clément Bœsch <cboesch@gopro.com> | 2017-03-15 14:23:18 +0300 |
commit | 89a032634b6edde1efa402d7deaa66fa25dd3e2b (patch) | |
tree | 47ecef095c429a4d2b321484a2b4d950724e3ed2 | |
parent | 1ade4d87bae8db3f2073c18eb322382ad7827bb9 (diff) | |
parent | b183abfb5b6366b177cf44f244c66156257a6fd6 (diff) |
Merge commit 'b183abfb5b6366b177cf44f244c66156257a6fd6'
* commit 'b183abfb5b6366b177cf44f244c66156257a6fd6':
vpx: Support color range
Decoder chunk not merged as the framework automatically copies avctx
color range to the frame color range. And we already set the avctx field
since cbcc88c039.
Merged-by: Clément Bœsch <cboesch@gopro.com>
-rw-r--r-- | libavcodec/libvpxenc.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c index 7c567a0d1d..b8e8d3a87b 100644 --- a/libavcodec/libvpxenc.c +++ b/libavcodec/libvpxenc.c @@ -1020,6 +1020,16 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket *pkt, rawimg_alpha->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; } |