diff mbox

[FFmpeg-devel,1/2] cbs_h264: Fix missing inferred colour description fields

Message ID 20190728182316.8700-1-sw@jkqxz.net
State Accepted
Commit f9b8503639c0ff90846f07c92e2fe7836690dd0c
Headers show

Commit Message

Mark Thompson July 28, 2019, 6:23 p.m. UTC
With video_signal_type_present_flag set but colour_description_present_flag
unset the colour fields would not have had their correct values inferred.
---
 libavcodec/cbs_h264_syntax_template.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Andreas Rheinhardt July 28, 2019, 11:31 p.m. UTC | #1
Mark Thompson:
> With video_signal_type_present_flag set but colour_description_present_flag
> unset the colour fields would not have had their correct values inferred.
> ---
>  libavcodec/cbs_h264_syntax_template.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/libavcodec/cbs_h264_syntax_template.c b/libavcodec/cbs_h264_syntax_template.c
> index 26be6e590f..1671a15d33 100644
> --- a/libavcodec/cbs_h264_syntax_template.c
> +++ b/libavcodec/cbs_h264_syntax_template.c
> @@ -137,6 +137,10 @@ static int FUNC(vui_parameters)(CodedBitstreamContext *ctx, RWContext *rw,
>              ub(8, colour_primaries);
>              ub(8, transfer_characteristics);
>              ub(8, matrix_coefficients);
> +        } else {
> +            infer(colour_primaries,         2);
> +            infer(transfer_characteristics, 2);
> +            infer(matrix_coefficients,      2);
>          }
>      } else {
>          infer(video_format,             5);
> 
LGTM. And sorry for not catching this before 43a18884.

- Andreas
Mark Thompson July 29, 2019, 7:03 p.m. UTC | #2
On 29/07/2019 00:31, Andreas Rheinhardt wrote:
> Mark Thompson:
>> With video_signal_type_present_flag set but colour_description_present_flag
>> unset the colour fields would not have had their correct values inferred.
>> ---
>>  libavcodec/cbs_h264_syntax_template.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/libavcodec/cbs_h264_syntax_template.c b/libavcodec/cbs_h264_syntax_template.c
>> index 26be6e590f..1671a15d33 100644
>> --- a/libavcodec/cbs_h264_syntax_template.c
>> +++ b/libavcodec/cbs_h264_syntax_template.c
>> @@ -137,6 +137,10 @@ static int FUNC(vui_parameters)(CodedBitstreamContext *ctx, RWContext *rw,
>>              ub(8, colour_primaries);
>>              ub(8, transfer_characteristics);
>>              ub(8, matrix_coefficients);
>> +        } else {
>> +            infer(colour_primaries,         2);
>> +            infer(transfer_characteristics, 2);
>> +            infer(matrix_coefficients,      2);
>>          }
>>      } else {
>>          infer(video_format,             5);
>>
> LGTM. And sorry for not catching this before 43a18884.

Both patches applied.

Thank you!

- Mark
diff mbox

Patch

diff --git a/libavcodec/cbs_h264_syntax_template.c b/libavcodec/cbs_h264_syntax_template.c
index 26be6e590f..1671a15d33 100644
--- a/libavcodec/cbs_h264_syntax_template.c
+++ b/libavcodec/cbs_h264_syntax_template.c
@@ -137,6 +137,10 @@  static int FUNC(vui_parameters)(CodedBitstreamContext *ctx, RWContext *rw,
             ub(8, colour_primaries);
             ub(8, transfer_characteristics);
             ub(8, matrix_coefficients);
+        } else {
+            infer(colour_primaries,         2);
+            infer(transfer_characteristics, 2);
+            infer(matrix_coefficients,      2);
         }
     } else {
         infer(video_format,             5);