]> git.sesse.net Git - ffmpeg/commitdiff
Merge remote-tracking branch 'shariman/wmall'
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 20 Nov 2011 14:43:19 +0000 (15:43 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 20 Nov 2011 14:43:19 +0000 (15:43 +0100)
* shariman/wmall: (24 commits)
  Clean-up
  dump_int_buffer() to dump samples from a buffer
  Implement revert_cdlms()
  Doxy for reset_codec()
  Store transient state and position of transient area
  Implement use_high_update_speed() and use_normal_update_speed()
  Initialize num_logged_tiles and remove unnecessary codes
  Log index for each line of output
  Log tile size
  Output decoded residues
  Replace placeholders with actual calls to clear_codec_buffers() and reset_codec()
  Implement lms_update()
  Implement lms_predict()
  Implement reset_codec()
  Add missing syntax elements to WmallDecodeCtx
  Add .recent syntax element to cdlms struct
  Implement clear_codec_buffers()
  Add buffers to context necessary for reverting cdmls and mclms filter
  Use avpriv_copy_bits() instead of ff_copy_bits()
  Cosmetics
  ...

Conflicts:
libavcodec/wmalosslessdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
configure
libavcodec/wmalosslessdec.c
libavformat/Makefile

diff --cc configure
Simple merge
index 7427cb873f4c6f318692313a55f6e6a2d7a9bca9,3ae698538b4ebf4ee5bfb32a17205adf36b90e76..a26c2a72445c068a1353f1889e4ee94fc6d4c182
@@@ -501,12 -512,12 +512,12 @@@ static int decode_tilehdr(WmallDecodeCt
          for (c = 0; c < s->num_channels; c++) {
              if (num_samples[c] == min_channel_len) {
                  if (fixed_channel_layout || channels_for_cur_subframe == 1 ||
-                     (min_channel_len == s->samples_per_frame - s->min_samples_per_subframe)) {
+                   (min_channel_len == s->samples_per_frame - s->min_samples_per_subframe)) {
                      contains_subframe[c] = 1;
-                 }
 -              }                   
++              }
                  else {
-                     contains_subframe[c] = get_bits1(&s->gb);   // XXX: locate in the spec
-                 }
+                     contains_subframe[c] = get_bits1(&s->gb);
+               }
              } else
                  contains_subframe[c] = 0;
          }
@@@ -589,26 -600,26 +600,26 @@@ static void decode_mclms(WmallDecodeCt
      s->mclms_order = (get_bits(&s->gb, 4) + 1) * 2;
      s->mclms_scaling = get_bits(&s->gb, 4);
      if(get_bits1(&s->gb)) {
-         // mclms_send_coef
-         int i;
-         int send_coef_bits;
-         int cbits = av_log2(s->mclms_scaling + 1);
-         assert(cbits == my_log2(s->mclms_scaling + 1));
-         if(1 << cbits < s->mclms_scaling + 1)
-             cbits++;
-         send_coef_bits = (cbits ? get_bits(&s->gb, cbits) : 0) + 2;
-         for(i = 0; i < s->mclms_order * s->num_channels * s->num_channels; i++) {
-             s->mclms_coeffs[i] = get_bits(&s->gb, send_coef_bits);
-         }
-         for(i = 0; i < s->num_channels; i++) {
-             int c;
-             for(c = 0; c < i; c++) {
-                 s->mclms_coeffs_cur[i * s->num_channels + c] = get_bits(&s->gb, send_coef_bits);
-             }
-         }
+       // mclms_send_coef
+       int i;
+       int send_coef_bits;
+       int cbits = av_log2(s->mclms_scaling + 1);
+       assert(cbits == my_log2(s->mclms_scaling + 1));
+       if(1 << cbits < s->mclms_scaling + 1)
+           cbits++;
+       send_coef_bits = (cbits ? get_bits(&s->gb, cbits) : 0) + 2;
+       for(i = 0; i < s->mclms_order * s->num_channels * s->num_channels; i++) {
+           s->mclms_coeffs[i] = get_bits(&s->gb, send_coef_bits);
 -      }           
++      }
+       for(i = 0; i < s->num_channels; i++) {
+           int c;
+           for(c = 0; c < i; c++) {
+               s->mclms_coeffs_cur[i * s->num_channels + c] = get_bits(&s->gb, send_coef_bits);
+           }
+       }
      }
  }
  
@@@ -622,36 -633,36 +633,36 @@@ static void decode_cdlms(WmallDecodeCt
      int cdlms_send_coef = get_bits1(&s->gb);
  
      for(c = 0; c < s->num_channels; c++) {
-         s->cdlms_ttl[c] = get_bits(&s->gb, 3) + 1;
-         for(i = 0; i < s->cdlms_ttl[c]; i++) {
-             s->cdlms[c][i].order = (get_bits(&s->gb, 7) + 1) * 8;
-         }
-         for(i = 0; i < s->cdlms_ttl[c]; i++) {
-             s->cdlms[c][i].scaling = get_bits(&s->gb, 4);
-         }
-         if(cdlms_send_coef) {
-             for(i = 0; i < s->cdlms_ttl[c]; i++) {
-                 int cbits, shift_l, shift_r, j;
-                 cbits = av_log2(s->cdlms[c][i].order);
-                 if(1 << cbits < s->cdlms[c][i].order)
-                     cbits++;
-                 s->cdlms[c][i].coefsend = get_bits(&s->gb, cbits) + 1;
-                 cbits = av_log2(s->cdlms[c][i].scaling + 1);
-                 if(1 << cbits < s->cdlms[c][i].scaling + 1)
-                     cbits++;
-                 s->cdlms[c][i].bitsend = get_bits(&s->gb, cbits) + 2;
-                 shift_l = 32 - s->cdlms[c][i].bitsend;
-                 shift_r = 32 - 2 - s->cdlms[c][i].scaling;
-                 for(j = 0; j < s->cdlms[c][i].coefsend; j++) {
-                     s->cdlms[c][i].coefs[j] =
-                         (get_bits(&s->gb, s->cdlms[c][i].bitsend) << shift_l) >> shift_r;
-                 }
-             }
-         }
+       s->cdlms_ttl[c] = get_bits(&s->gb, 3) + 1;
+       for(i = 0; i < s->cdlms_ttl[c]; i++) {
+           s->cdlms[c][i].order = (get_bits(&s->gb, 7) + 1) * 8;
+       }
+       for(i = 0; i < s->cdlms_ttl[c]; i++) {
+           s->cdlms[c][i].scaling = get_bits(&s->gb, 4);
+       }
+       if(cdlms_send_coef) {
+           for(i = 0; i < s->cdlms_ttl[c]; i++) {
+               int cbits, shift_l, shift_r, j;
+               cbits = av_log2(s->cdlms[c][i].order);
+               if(1 << cbits < s->cdlms[c][i].order)
+                   cbits++;
+               s->cdlms[c][i].coefsend = get_bits(&s->gb, cbits) + 1;
+               cbits = av_log2(s->cdlms[c][i].scaling + 1);
+               if(1 << cbits < s->cdlms[c][i].scaling + 1)
+                   cbits++;
 -              
++
+               s->cdlms[c][i].bitsend = get_bits(&s->gb, cbits) + 2;
+               shift_l = 32 - s->cdlms[c][i].bitsend;
+               shift_r = 32 - 2 - s->cdlms[c][i].scaling;
+               for(j = 0; j < s->cdlms[c][i].coefsend; j++) {
 -                  s->cdlms[c][i].coefs[j] = 
++                  s->cdlms[c][i].coefs[j] =
+                       (get_bits(&s->gb, s->cdlms[c][i].bitsend) << shift_l) >> shift_r;
+               }
+           }
+       }
      }
  }
  
@@@ -918,26 -975,26 +975,26 @@@ static int decode_subframe(WmallDecodeC
      if(s->seekable_tile) {
          clear_codec_buffers(s);
  
-         s->do_arith_coding    = get_bits1(&s->gb);
-         if(s->do_arith_coding) {
-             dprintf(s->avctx, "do_arith_coding == 1");
-             abort();
-         }
-         s->do_ac_filter       = get_bits1(&s->gb);
-         s->do_inter_ch_decorr = get_bits1(&s->gb);
-         s->do_mclms           = get_bits1(&s->gb);
+       s->do_arith_coding    = get_bits1(&s->gb);
+       if(s->do_arith_coding) {
+           dprintf(s->avctx, "do_arith_coding == 1");
+           abort();
+       }
+       s->do_ac_filter       = get_bits1(&s->gb);
+       s->do_inter_ch_decorr = get_bits1(&s->gb);
+       s->do_mclms           = get_bits1(&s->gb);
 -      
 +
-         if(s->do_ac_filter)
-             decode_ac_filter(s);
+       if(s->do_ac_filter)
+           decode_ac_filter(s);
  
-         if(s->do_mclms)
-             decode_mclms(s);
+       if(s->do_mclms)
+           decode_mclms(s);
  
-         decode_cdlms(s);
-         s->movave_scaling = get_bits(&s->gb, 3);
-         s->quant_stepsize = get_bits(&s->gb, 8) + 1;
+       decode_cdlms(s);
+       s->movave_scaling = get_bits(&s->gb, 3);
+       s->quant_stepsize = get_bits(&s->gb, 8) + 1;
  
-             reset_codec(s);
+           reset_codec(s);
      }
  
      rawpcm_tile = get_bits1(&s->gb);
      }
  
      if(rawpcm_tile) {
 -      
 +
-         int bits = s->bits_per_sample - padding_zeroes;
-         int j;
-         dprintf(s->avctx, "RAWPCM %d bits per sample. total %d bits, remain=%d\n", bits,
-                 bits * s->num_channels * subframe_len, get_bits_count(&s->gb));
-         for(i = 0; i < s->num_channels; i++) {
-             for(j = 0; j < subframe_len; j++) {
-                 s->channel_coeffs[i][j] = get_sbits(&s->gb, bits);
- //                dprintf(s->avctx, "PCM[%d][%d] = 0x%04x\n", i, j, s->channel_coeffs[i][j]);
-             }
-         }
+       int bits = s->bits_per_sample - padding_zeroes;
+       int j;
+       dprintf(s->avctx, "RAWPCM %d bits per sample. total %d bits, remain=%d\n", bits,
+               bits * s->num_channels * subframe_len, get_bits_count(&s->gb));
+       for(i = 0; i < s->num_channels; i++) {
+           for(j = 0; j < subframe_len; j++) {
+               s->channel_coeffs[i][j] = get_sbits(&s->gb, bits);
+ //            dprintf(s->avctx, "PCM[%d][%d] = 0x%04x\n", i, j, s->channel_coeffs[i][j]);
+           }
+       }
      } else {
-         for(i = 0; i < s->num_channels; i++)
-             if(s->is_channel_coded[i])
-                 decode_channel_residues(s, i, subframe_len);
+       for(i = 0; i < s->num_channels; i++)
+           if(s->is_channel_coded[i])
+               decode_channel_residues(s, i, subframe_len);
      }
  
      /** handled one subframe */
Simple merge