Merge commit '4b07ebf1eb13561492f7e3c30a67f34415016b3e'
authorClément Bœsch <u@pkh.me>
Fri, 24 Mar 2017 10:31:30 +0000 (11:31 +0100)
committerClément Bœsch <u@pkh.me>
Fri, 24 Mar 2017 10:33:47 +0000 (11:33 +0100)
* 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@pkh.me>
1  2 
libavformat/mov.c

  #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;