Merge commit '5dd8c08fd5e4c04d7a08d8934f0098a8a4a35c28'
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 27 Jun 2014 17:20:12 +0000 (19:20 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 27 Jun 2014 17:24:44 +0000 (19:24 +0200)
* commit '5dd8c08fd5e4c04d7a08d8934f0098a8a4a35c28':
  mpeg: Change ff_convert_matrix() to take an MpegEncContext parameter

Conflicts:
libavcodec/mpegvideo.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/dnxhdenc.c
libavcodec/mpegvideo.h
libavcodec/mpegvideo_enc.c

Simple merge
@@@ -756,8 -726,7 +756,8 @@@ int ff_mpeg_update_thread_context(AVCod
  void ff_set_qscale(MpegEncContext * s, int qscale);
  
  int ff_dct_common_init(MpegEncContext *s);
- void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64], uint16_t (*qmat16)[2][64],
 +int ff_dct_encode_init(MpegEncContext *s);
+ void ff_convert_matrix(MpegEncContext *s, int (*qmat)[64], uint16_t (*qmat16)[2][64],
                         const uint16_t *quant_matrix, int bias, int qmin, int qmax, int intra);
  int ff_dct_quantize_c(MpegEncContext *s, int16_t *block, int n, int qscale, int *overflow);
  
@@@ -3558,31 -3365,9 +3559,31 @@@ static int encode_picture(MpegEncContex
          }
          s->y_dc_scale_table=
          s->c_dc_scale_table= ff_mpeg2_dc_scale_table[s->intra_dc_precision];
 +        s->chroma_intra_matrix[0] =
          s->intra_matrix[0] = ff_mpeg2_dc_scale_table[s->intra_dc_precision][8];
-         ff_convert_matrix(&s->dsp, s->q_intra_matrix, s->q_intra_matrix16,
+         ff_convert_matrix(s, s->q_intra_matrix, s->q_intra_matrix16,
                         s->intra_matrix, s->intra_quant_bias, 8, 8, 1);
-         ff_convert_matrix(&s->dsp, s->q_chroma_intra_matrix, s->q_chroma_intra_matrix16,
++        ff_convert_matrix(s, s->q_chroma_intra_matrix, s->q_chroma_intra_matrix16,
 +                       s->chroma_intra_matrix, s->intra_quant_bias, 8, 8, 1);
 +        s->qscale= 8;
 +    }
 +    if(s->codec_id == AV_CODEC_ID_AMV){
 +        static const uint8_t y[32]={13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13};
 +        static const uint8_t c[32]={14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14};
 +        for(i=1;i<64;i++){
 +            int j= s->dsp.idct_permutation[ff_zigzag_direct[i]];
 +
 +            s->intra_matrix[j] = sp5x_quant_table[5*2+0][i];
 +            s->chroma_intra_matrix[j] = sp5x_quant_table[5*2+1][i];
 +        }
 +        s->y_dc_scale_table= y;
 +        s->c_dc_scale_table= c;
 +        s->intra_matrix[0] = 13;
 +        s->chroma_intra_matrix[0] = 14;
-         ff_convert_matrix(&s->dsp, s->q_intra_matrix, s->q_intra_matrix16,
++        ff_convert_matrix(s, s->q_intra_matrix, s->q_intra_matrix16,
 +                       s->intra_matrix, s->intra_quant_bias, 8, 8, 1);
-         ff_convert_matrix(&s->dsp, s->q_chroma_intra_matrix, s->q_chroma_intra_matrix16,
++        ff_convert_matrix(s, s->q_chroma_intra_matrix, s->q_chroma_intra_matrix16,
 +                       s->chroma_intra_matrix, s->intra_quant_bias, 8, 8, 1);
          s->qscale= 8;
      }