[FFmpeg-devel] [PATCH] multichannel cook support (working)
Michael Niedermayer
michaelni
Sun Apr 19 20:36:39 CEST 2009
On Fri, Apr 10, 2009 at 11:47:55PM +0200, Benjamin Larsson wrote:
> Hi, this is the first patch towards complete multichannel support in
> cook. I tried to make this as atomic and small as possible. I am the
> maintainer for the file but as the patch is quite large so I want some
> comments. So any comments ?
>
> After the patch there will follow a set of changes for some cosmetics
> and then proper channel layout handling.
>
> Credits for figuring out all this goes to Sasha Sommer.
Missing context in av_log
mc_cook.diff:734:+ av_log(NULL,AV_LOG_ERROR,"total %i\n",q->subpacket[s].total_subbands);
divide by 2^x could use >> maybe
mc_cook.diff:425:+ p->bits_per_subpacket/8);
mc_cook.diff:462:+ decode_bytes_and_gain(q, p, inbuffer + sub_packet_size/2, &p->gains2);
mc_cook.diff:688:+ q->subpacket[s].samples_per_channel = q->subpacket[s].samples_per_frame / 2;
Missing changelog entry (ignore if minor change)
Mergeable calls
av_log(q->avctx,AV_LOG_ERROR," %s = %d\n", a, b);
av_log
[...]
> cook.c | 468 +++++++++++++++++++++++++++++++++++++----------------------------
> 1 file changed, 270 insertions(+), 198 deletions(-)
> Index: libavcodec/cook.c
> ===================================================================
> --- libavcodec/cook.c (revision 18424)
> +++ libavcodec/cook.c (working copy)
> @@ -70,6 +70,36 @@
> int *previous;
> } cook_gains;
>
> +typedef struct {
> + int ch_idx;
> + int size;
> + int num_channels;
> + int cookversion;
> + int samples_per_frame;
> + int subbands;
> + int js_subband_start;
> + int js_vlc_bits;
> + int samples_per_channel;
> + int log2_numvector_size;
> + unsigned int channel_mask;
> + VLC ccpl; ///< channel coupling
> + int joint_stereo;
> + int bits_per_subpacket;
> + int bits_per_subpdiv;
> + int total_subbands;
> + int numvector_size; ///< 1 << log2_numvector_size;
> +
> + float mono_previous_buffer1[1024];
> + float mono_previous_buffer2[1024];
> + /** gain buffers */
> + cook_gains gains1;
> + cook_gains gains2;
> + int gain_1[9];
> + int gain_2[9];
> + int gain_3[9];
> + int gain_4[9];
> +} COOKSubpacket;
> +
> typedef struct cook {
> /*
> * The following 5 functions provide the lowlevel arithmetic on
> @@ -80,6 +110,7 @@
> float* mlt_p);
>
> void (* decouple) (struct cook *q,
> + COOKSubpacket *p,
> int subband,
> float f1, float f2,
> float *decode_buffer,
> @@ -97,19 +128,10 @@
> GetBitContext gb;
> /* stream data */
> int nb_channels;
> - int joint_stereo;
> int bit_rate;
> int sample_rate;
> + int num_vectors;
> int samples_per_channel;
> - int samples_per_frame;
> - int subbands;
> - int log2_numvector_size;
> - int numvector_size; //1 << log2_numvector_size;
> - int js_subband_start;
> - int total_subbands;
> - int num_vectors;
> - int bits_per_subpacket;
> - int cookversion;
> /* states */
> AVLFG random_state;
>
> @@ -117,19 +139,9 @@
> MDCTContext mdct_ctx;
> float* mlt_window;
>
> - /* gain buffers */
> - cook_gains gains1;
> - cook_gains gains2;
> - int gain_1[9];
> - int gain_2[9];
> - int gain_3[9];
> - int gain_4[9];
> -
> /* VLC data */
> - int js_vlc_bits;
> VLC envelope_quant_index[13];
> VLC sqvh[7]; //scalar quantization
> - VLC ccpl; //channel coupling
>
> /* generatable tables and related variables */
> int gain_size_factor;
> @@ -139,13 +151,13 @@
>
> uint8_t* decoded_bytes_buffer;
> DECLARE_ALIGNED_16(float,mono_mdct_output[2048]);
> - float mono_previous_buffer1[1024];
> - float mono_previous_buffer2[1024];
> float decode_buffer_1[1024];
> float decode_buffer_2[1024];
> float decode_buffer_0[1060]; /* static allocation for joint decode */
>
> const float *cplscales[5];
> + int num_subpackets;
> + COOKSubpacket subpacket[MAX_SUBPACKETS];
> } COOKContext;
>
> static float pow2tab[127];
i think factoring COOKSubpacket out should be a seperate patch
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090419/4a3917ef/attachment.pgp>
More information about the ffmpeg-devel
mailing list