Commit 4405ff2c authored by Carl Eugen Hoyos's avatar Carl Eugen Hoyos

lavc/hevc_ps: Fix default display window offsets for yuv422 and yuv444.

parent ed5d295a
...@@ -596,11 +596,12 @@ static void decode_vui(GetBitContext *gb, AVCodecContext *avctx, ...@@ -596,11 +596,12 @@ static void decode_vui(GetBitContext *gb, AVCodecContext *avctx,
memcpy(&backup, gb, sizeof(backup)); memcpy(&backup, gb, sizeof(backup));
if (vui->default_display_window_flag) { if (vui->default_display_window_flag) {
//TODO: * 2 is only valid for 420 int vert_mult = 1 + (sps->chroma_format_idc < 2);
vui->def_disp_win.left_offset = get_ue_golomb_long(gb) * 2; int horiz_mult = 1 + (sps->chroma_format_idc < 3);
vui->def_disp_win.right_offset = get_ue_golomb_long(gb) * 2; vui->def_disp_win.left_offset = get_ue_golomb_long(gb) * horiz_mult;
vui->def_disp_win.top_offset = get_ue_golomb_long(gb) * 2; vui->def_disp_win.right_offset = get_ue_golomb_long(gb) * horiz_mult;
vui->def_disp_win.bottom_offset = get_ue_golomb_long(gb) * 2; vui->def_disp_win.top_offset = get_ue_golomb_long(gb) * vert_mult;
vui->def_disp_win.bottom_offset = get_ue_golomb_long(gb) * vert_mult;
if (apply_defdispwin && if (apply_defdispwin &&
avctx->flags2 & AV_CODEC_FLAG2_IGNORE_CROP) { avctx->flags2 & AV_CODEC_FLAG2_IGNORE_CROP) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment