diff mbox series

[FFmpeg-devel,v7,19.1/23] cbs_h265: Remove restrictions on MDCV values

Message ID 20200812213213.429536-1-sw@jkqxz.net
State New
Headers show
Series [FFmpeg-devel,v7,19.1/23] cbs_h265: Remove restrictions on MDCV values
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Mark Thompson Aug. 12, 2020, 9:32 p.m. UTC
Since this was originally written H.265 has changed to allow arbitrary
values here, but leaves their meaning unspecified.
---
On 12/08/2020 00:03, Andreas Rheinhardt wrote:
> Obviously, the code for reading/writing the mastering display colour
> volume SEI needs to be updated, too.

Yeah.  I don't think there is any verification we can now do here, so this just removes all restrictions.


 libavcodec/cbs_h265_syntax_template.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/cbs_h265_syntax_template.c b/libavcodec/cbs_h265_syntax_template.c
index 48fae82d04..1b0a31b575 100644
--- a/libavcodec/cbs_h265_syntax_template.c
+++ b/libavcodec/cbs_h265_syntax_template.c
@@ -2030,17 +2030,15 @@  static int FUNC(sei_mastering_display)(CodedBitstreamContext *ctx, RWContext *rw
     HEADER("Mastering Display Colour Volume");
 
     for (c = 0; c < 3; c++) {
-        us(16, display_primaries_x[c], 0, 50000, 1, c);
-        us(16, display_primaries_y[c], 0, 50000, 1, c);
+        ubs(16, display_primaries_x[c], 1, c);
+        ubs(16, display_primaries_y[c], 1, c);
     }
 
-    u(16, white_point_x, 0, 50000);
-    u(16, white_point_y, 0, 50000);
+    ub(16, white_point_x);
+    ub(16, white_point_y);
 
-    u(32, max_display_mastering_luminance,
-      1, MAX_UINT_BITS(32));
-    u(32, min_display_mastering_luminance,
-      0, current->max_display_mastering_luminance - 1);
+    ub(32, max_display_mastering_luminance);
+    ub(32, min_display_mastering_luminance);
 
     return 0;
 }