[FFmpeg-cvslog] Merge commit '4b07ebf1eb13561492f7e3c30a67f34415016b3e'

Clément Bœsch git at videolan.org
Fri Mar 24 12:33:59 EET 2017


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Fri Mar 24 11:31:30 2017 +0100| [30ac66abf0995c3a9a6c5370d357e51268b1b69f] | committer: Clément Bœsch

Merge commit '4b07ebf1eb13561492f7e3c30a67f34415016b3e'

* commit '4b07ebf1eb13561492f7e3c30a67f34415016b3e':
  mov: Update colr values

Mostly noop, see a3cab3d43387add8914c1c471fc99d733227d81b

Only the use of av_color_{primaries,transfer,space}_name() is merged.

Merged-by: Clément Bœsch <u at pkh.me>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=30ac66abf0995c3a9a6c5370d357e51268b1b69f
---

 libavformat/mov.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 3754346..5b82dd6 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -41,6 +41,7 @@
 #include "libavutil/opt.h"
 #include "libavutil/aes.h"
 #include "libavutil/aes_ctr.h"
+#include "libavutil/pixdesc.h"
 #include "libavutil/sha.h"
 #include "libavutil/spherical.h"
 #include "libavutil/stereo3d.h"
@@ -1362,12 +1363,14 @@ static int mov_read_colr(MOVContext *c, AVIOContext *pb, MOVAtom atom)
         else
             st->codecpar->color_range = AVCOL_RANGE_MPEG;
     }
-    if (color_primaries >= AVCOL_PRI_NB)
+
+    if (!av_color_primaries_name(color_primaries))
         color_primaries = AVCOL_PRI_UNSPECIFIED;
-    if (color_trc >= AVCOL_TRC_NB)
+    if (!av_color_transfer_name(color_trc))
         color_trc = AVCOL_TRC_UNSPECIFIED;
-    if (color_matrix >= AVCOL_SPC_NB)
+    if (!av_color_space_name(color_matrix))
         color_matrix = AVCOL_SPC_UNSPECIFIED;
+
     st->codecpar->color_primaries = color_primaries;
     st->codecpar->color_trc       = color_trc;
     st->codecpar->color_space     = color_matrix;


======================================================================

diff --cc libavformat/mov.c
index 3754346,fee9f36..5b82dd6
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@@ -34,20 -33,11 +34,21 @@@
  #include "libavutil/intfloat.h"
  #include "libavutil/mathematics.h"
  #include "libavutil/time_internal.h"
 +#include "libavutil/avassert.h"
  #include "libavutil/avstring.h"
  #include "libavutil/dict.h"
 +#include "libavutil/display.h"
  #include "libavutil/opt.h"
 +#include "libavutil/aes.h"
 +#include "libavutil/aes_ctr.h"
+ #include "libavutil/pixdesc.h"
 +#include "libavutil/sha.h"
 +#include "libavutil/spherical.h"
 +#include "libavutil/stereo3d.h"
 +#include "libavutil/timecode.h"
  #include "libavcodec/ac3tab.h"
 +#include "libavcodec/flac.h"
 +#include "libavcodec/mpegaudiodecheader.h"
  #include "avformat.h"
  #include "internal.h"
  #include "avio_internal.h"
@@@ -1361,16 -1084,41 +1362,18 @@@ static int mov_read_colr(MOVContext *c
              st->codecpar->color_range = AVCOL_RANGE_JPEG;
          else
              st->codecpar->color_range = AVCOL_RANGE_MPEG;
 -
 -        if (!av_color_primaries_name(color_primaries))
 -            color_primaries = AVCOL_PRI_UNSPECIFIED;
 -        if (!av_color_transfer_name(color_trc))
 -            color_trc = AVCOL_TRC_UNSPECIFIED;
 -        if (!av_color_space_name(color_matrix))
 -            color_matrix = AVCOL_SPC_UNSPECIFIED;
 -
 -        st->codecpar->color_primaries = color_primaries;
 -        st->codecpar->color_trc       = color_trc;
 -        st->codecpar->color_space     = color_matrix;
 -    } else if (!strncmp(color_parameter_type, "nclc", 4)) {
 -        /* color primaries, Table 4-4 */
 -        switch (color_primaries) {
 -        case 1: st->codecpar->color_primaries = AVCOL_PRI_BT709; break;
 -        case 5: st->codecpar->color_primaries = AVCOL_PRI_SMPTE170M; break;
 -        case 6: st->codecpar->color_primaries = AVCOL_PRI_SMPTE240M; break;
 -        case 9: st->codecpar->color_primaries = AVCOL_PRI_BT2020; break;
 -        case 10: st->codecpar->color_primaries = AVCOL_PRI_SMPTE431; break;
 -        case 11: st->codecpar->color_primaries = AVCOL_PRI_SMPTE432; break;
 -        }
 -        /* color transfer, Table 4-5 */
 -        switch (color_trc) {
 -        case 1: st->codecpar->color_trc = AVCOL_TRC_BT709; break;
 -        case 7: st->codecpar->color_trc = AVCOL_TRC_SMPTE240M; break;
 -        case 17: st->codecpar->color_trc = AVCOL_TRC_SMPTE428; break;
 -        }
 -        /* color matrix, Table 4-6 */
 -        switch (color_matrix) {
 -        case 1: st->codecpar->color_space = AVCOL_SPC_BT709; break;
 -        case 6: st->codecpar->color_space = AVCOL_SPC_BT470BG; break;
 -        case 7: st->codecpar->color_space = AVCOL_SPC_SMPTE240M; break;
 -        case 9: st->codecpar->color_space = AVCOL_SPC_BT2020_NCL; break;
 -        }
      }
-     if (color_primaries >= AVCOL_PRI_NB)
++
++    if (!av_color_primaries_name(color_primaries))
 +        color_primaries = AVCOL_PRI_UNSPECIFIED;
-     if (color_trc >= AVCOL_TRC_NB)
++    if (!av_color_transfer_name(color_trc))
 +        color_trc = AVCOL_TRC_UNSPECIFIED;
-     if (color_matrix >= AVCOL_SPC_NB)
++    if (!av_color_space_name(color_matrix))
 +        color_matrix = AVCOL_SPC_UNSPECIFIED;
++
 +    st->codecpar->color_primaries = color_primaries;
 +    st->codecpar->color_trc       = color_trc;
 +    st->codecpar->color_space     = color_matrix;
      av_log(c->fc, AV_LOG_TRACE, "\n");
  
      return 0;



More information about the ffmpeg-cvslog mailing list