aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorJan Ekström <jeebjp@gmail.com>2021-08-24 00:28:39 +0300
committerJan Ekström <jeebjp@gmail.com>2021-08-29 15:05:37 +0300
commit2f0113be3ffb566f1bb7f3140f038318c447da9f (patch)
tree590ab3acdfed79862f9b599b6ee1ddbd852112d4 /libavcodec
parente07ada3dac9c2e37c425741ee512676625d677ba (diff)
downloadffmpeg-2f0113be3ffb566f1bb7f3140f038318c447da9f.tar.gz
avcodec/libx264: add support for setting chroma sample location
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/libx264.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index d48e142e41..379c167e6f 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -870,6 +870,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.vui.i_colorprim = avctx->color_primaries;
if (avctx->color_trc != AVCOL_TRC_UNSPECIFIED)
x4->params.vui.i_transfer = avctx->color_trc;
+ if (avctx->chroma_sample_location != AVCHROMA_LOC_UNSPECIFIED)
+ x4->params.vui.i_chroma_loc = avctx->chroma_sample_location - 1;
if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER)
x4->params.b_repeat_headers = 0;