[vlc-devel] [PATCH 00/28] Rational numbers

Steve Lhomme robux4 at gmail.com
Mon Apr 3 09:51:18 CEST 2017


On Sun, Apr 2, 2017 at 11:26 PM, Filip Roséen <filip at atch.se> wrote:
> Hi Steve,
>
> Have you verified that using vlc_rational_t in all places you propose
> changes does not lead to unexpected behavior?
>
> Such as making sure that the relevant spec where the values are coming from
> does not allow negative values for calculating the ratio, as well as that
> all “incoming” values really fit inside an unsigned on all platforms?

Yes I only changed the ones that were already using unsigned. Plus the
sar in vout_display_state_t which was always used from unsigned
values.

The zoom was kept as-is because it can have negative values.

> On 2017-03-31 18:14, Steve Lhomme wrote:
>
>  While working on HDR metadata I noticed that it would me more accurate to
>  handle them as rational numbers. But it seems we do not have that in the
> core.
>
>  So I went ahead and added vlc_rational_t.
>
>  Only the first 3 patches would be nice to merge, the rest is extra by using
> the
>  type where rational numbers were already used.
>
>  Steve Lhomme (28):
>    vlc_vout_wrapper: the sar is always unsigned
>    core: add a vlc_rational_t type for unsigned rational numbers
>    core: turn mastering colour luminance into rational numbers
>    avcodec/avformat: simplify AVRational copying
>    avcommon: add a conversion from AVRational to vlc_rational_t
>    always call var_InheritURational with a vlc_rational_t based output
>    core: change var_InheritURational to output a vlc_rational_t
>    mpegvideo: use vlc_rational_t for the internal frame rate
>    linsys: use vlc_rational_t internally
>    demux: ogg: use vlc_rational_t internally
>    packetizer: mpeg4video: use vlc_rational_t internally
>    demux: mpeg: use vlc_rational_t internally
>    mmal: vout: use vlc_rational_t internally for the frame rate
>    vlc_es: use vlc_rational_t for the frame rate
>    modules: simplify some vlc_rational_t value copying
>    simplify some frame rate checks
>    dvdread: use a vlc_rational_t internally for the SAR
>    codec: libmpeg2: use a vlc_rational_t internally for the SAR
>    packetizer: h264: use a vlc_rational_t internally for the SAR
>    stream_out: mosaic_bridge: use a vlc_rational_t internally for the SAR
>    vlc_es: use a vlc_rationale_t for the SAR
>    codec: avcodec: copy the source max light levels into the output
>      picture
>    access: dvdnav: use vlc_rational_t internally for the SAR
>    hxxx_helper: simplify h264_helper_get_current_sar using vlc_rational_t
>    demux: mp4: simplify TrackGetESSampleRate using vlc_rational_t
>    packetizer: hevc: simplify hevc_get_frame_rate() using vlc_rational_t
>    simplifying copying data between vlc_rational_t
>    do not test vlc_rational_t for negative values
>
>   include/vlc_common.h                               |  4 +
>   include/vlc_es.h                                   | 14 ++--
>   include/vlc_fourcc.h                               | 10 +--
>   include/vlc_variables.h                            |  4 +-
>   include/vlc_vout_display.h                         |  5 +-
>   include/vlc_vout_wrapper.h                         |  5 +-
>   lib/media.c                                        |  8 +-
>   lib/media_player.c                                 |  6 +-
>   modules/access/avcapture.m                         |  4 +-
>   modules/access/dcp/dcp.cpp                         |  4 +-
>   modules/access/decklink.cpp                        | 20 ++---
>   modules/access/dshow/dshow.cpp                     | 13 ++-
>   modules/access/dvdnav.c                            | 24 +++---
>   modules/access/dvdread.c                           | 22 +++--
>   modules/access/imem.c                              | 17 ++--
>   modules/access/linsys/linsys_hdsdi.c               | 37 ++++-----
>   modules/access/linsys/linsys_sdi.c                 | 43 +++++-----
>   modules/access/rdp.c                               |  4 +-
>   modules/access/screen/mac.c                        |  8 +-
>   modules/access/screen/wayland.c                    |  6 +-
>   modules/access/screen/win32.c                      |  2 +-
>   modules/access/screen/xcb.c                        |  6 +-
>   modules/access/shm.c                               |  6 +-
>   modules/access/timecode.c                          |  7 +-
>   modules/access/v4l2/demux.c                        | 14 ++--
>   modules/access/v4l2/video.c                        | 11 ++-
>   modules/access/vnc.c                               |  6 +-
>   modules/codec/aom.c                                |  6 +-
>   modules/codec/arib/substext.h                      |  6 +-
>   modules/codec/avcodec/avcommon.h                   |  5 ++
>   modules/codec/avcodec/d3d11va.c                    |  4 +-
>   modules/codec/avcodec/directx_va.c                 |  3 +-
>   modules/codec/avcodec/dxva2.c                      |  6 +-
>   modules/codec/avcodec/encoder.c                    | 24 ++----
>   modules/codec/avcodec/video.c                      | 80 +++++++++---------
>   modules/codec/bpg.c                                |  4 +-
>   modules/codec/cdg.c                                |  4 +-
>   modules/codec/crystalhd.c                          |  8 +-
>   modules/codec/cvdsub.c                             |  4 +-
>   modules/codec/daala.c                              | 30 +++----
>   modules/codec/dmo/dmo.c                            | 11 ++-
>   modules/codec/dvbsub.c                             |  8 +-
>   modules/codec/gstreamer/gstdecode.c                | 20 ++---
>   .../codec/gstreamer/gstvlcpictureplaneallocator.c  |  4 +-
>   modules/codec/hxxx_helper.c                        |  5 +-
>   modules/codec/hxxx_helper.h                        |  2 +-
>   modules/codec/jpeg.c                               |  4 +-
>   modules/codec/kate.c                               |  4 +-
>   modules/codec/libmpeg2.c                           | 42 +++++-----
>   modules/codec/oggspots.c                           |  8 +-
>   modules/codec/omxil/omxil.c                        | 29 +++----
>   modules/codec/png.c                                |  4 +-
>   modules/codec/qsv.c                                | 10 +--
>   modules/codec/rawvideo.c                           | 12 +--
>   modules/codec/schroedinger.c                       | 22 ++---
>   modules/codec/scte27.c                             |  4 +-
>   modules/codec/sdl_image.c                          |  4 +-
>   modules/codec/spudec/parse.c                       |  4 +-
>   modules/codec/substext.h                           | 14 ++--
>   modules/codec/subsusf.c                            |  2 +-
>   modules/codec/svcdsub.c                            |  4 +-
>   modules/codec/svg.c                                |  8 +-
>   modules/codec/theora.c                             | 26 +++---
>   modules/codec/videotoolbox.m                       | 20 ++---
>   modules/codec/vpx.c                                | 11 ++-
>   modules/codec/x264.c                               | 18 ++--
>   modules/codec/x265.c                               | 14 ++--
>   modules/codec/xwd.c                                |  4 +-
>   modules/codec/zvbi.c                               |  2 +-
>   modules/demux/asf/asf.c                            | 14 ++--
>   modules/demux/avformat/demux.c                     | 12 ++-
>   modules/demux/avformat/mux.c                       | 25 +++---
>   modules/demux/avi/avi.c                            |  8 +-
>   modules/demux/dirac.c                              |  6 +-
>   modules/demux/image.c                              | 14 ++--
>   modules/demux/mkv/matroska_segment_parse.cpp       | 12 +--
>   modules/demux/mkv/mkv.cpp                          |  4 +-
>   modules/demux/mp4/essetup.c                        |  8 +-
>   modules/demux/mp4/mp4.c                            | 17 ++--
>   modules/demux/mpeg/h26x.c                          | 38 ++++-----
>   modules/demux/mpeg/ts_psi.c                        |  4 +-
>   modules/demux/nuv.c                                |  4 +-
>   modules/demux/ogg.c                                | 50 ++++++-----
>   modules/demux/rawvid.c                             | 55 ++++++-------
>   modules/demux/real.c                               |  4 +-
>   modules/demux/vc1.c                                |  8 +-
>   modules/hw/mmal/codec.c                            |  7 +-
>   modules/hw/mmal/deinterlace.c                      | 15 ++--
>   modules/hw/mmal/vout.c                             | 24 +++---
>   modules/hw/vdpau/deinterlace.c                     |  8 +-
>   modules/misc/stats.c                               |  4 +-
>   modules/mux/asf.c                                  | 18 ++--
>   modules/mux/mp4/libmp4mux.c                        | 14 ++--
>   modules/mux/mp4/mp4.c                              | 22 ++---
>   modules/mux/mpeg/ts.c                              |  8 +-
>   modules/mux/ogg.c                                  | 38 ++++-----
>   modules/packetizer/dirac.c                         |  4 +-
>   modules/packetizer/h264.c                          | 21 +++--
>   modules/packetizer/h264_nal.c                      |  8 +-
>   modules/packetizer/h264_nal.h                      |  2 +-
>   modules/packetizer/hevc.c                          | 21 +++--
>   modules/packetizer/hevc_nal.c                      | 14 ++--
>   modules/packetizer/hevc_nal.h                      |  2 +-
>   modules/packetizer/mpeg4video.c                    | 32 ++++----
>   modules/packetizer/mpegvideo.c                     | 30 ++++---
>   modules/packetizer/vc1.c                           | 14 ++--
>   modules/spu/audiobargraph_v.c                      |  2 +-
>   modules/spu/logo.c                                 |  2 +-
>   modules/spu/marq.c                                 |  2 +-
>   modules/spu/remoteosd.c                            |  2 +-
>   modules/spu/rss.c                                  |  2 +-
>   modules/stream_out/mosaic_bridge.c                 | 38 ++++-----
>   modules/stream_out/transcode/transcode.c           |  2 +-
>   modules/stream_out/transcode/transcode.h           |  2 +-
>   modules/stream_out/transcode/video.c               | 92
> ++++++++++-----------
>   modules/text_renderer/freetype/freetype.c          |  4 +-
>   modules/video_chroma/swscale.c                     |  8 +-
>   modules/video_filter/canvas.c                      | 10 +--
>   modules/video_filter/deinterlace/deinterlace.c     |  4 +-
>   modules/video_filter/fps.c                         | 17 ++--
>   modules/video_filter/scene.c                       |  2 +-
>   modules/video_filter/transform.c                   |  7 +-
>   modules/video_output/android/display.c             | 21 +++--
>   modules/video_output/decklink.cpp                  | 10 +--
>   modules/video_output/opengl/internal.h             | 10 +--
>   modules/video_output/win32/direct3d11.c            | 22 ++---
>   modules/video_output/yuv.c                         | 11 ++-
>   modules/video_splitter/wall.c                      |  4 +-
>   modules/visualization/goom.c                       |  2 +-
>   modules/visualization/visual/visual.c              |  4 +-
>   src/input/decoder.c                                | 20 ++---
>   src/input/es_out.c                                 | 17 ++--
>   src/misc/es_format.c                               | 26 +++---
>   src/misc/fourcc_gen.c                              |  1 +
>   src/misc/image.c                                   | 46 +++++------
>   src/misc/picture.c                                 | 24 +++---
>   src/misc/subpicture.c                              |  4 +-
>   src/misc/variables.c                               | 16 ++--
>   src/video_output/display.c                         | 96
> +++++++++-------------
>   src/video_output/video_epg.c                       | 14 ++--
>   src/video_output/video_output.c                    | 35 ++++----
>   src/video_output/video_text.c                      |  8 +-
>   src/video_output/video_widgets.c                   | 14 ++--
>   src/video_output/vout_
> subpictures.c                | 14 ++--
>   test/libvlc/media.c                                |  2 +-
>   test/src/misc/variables.c                          | 58 ++++++-------
>   146 files changed, 996 insertions(+), 1082 deletions(-)
>
>  --
>  2.11.1
>
>  _______________________________________________
>  vlc-devel mailing list
>  To unsubscribe or modify your subscription options:
>  https://mailman.videolan.org/listinfo/vlc-devel
>
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list