[FFmpeg-devel] [PATCH] handle INT32INFO in WavPack decoder

Michael Niedermayer michaelni
Sun Aug 5 01:42:24 CEST 2007


Hi

On Sat, Aug 04, 2007 at 03:39:13PM -0700, David Bryant wrote:
> Hi.
>
> This patch adds the handling of the INT32INFO block to the WavPack decoder. 
> This block is used to properly decode integer samples over 24 bits, 

the dst array into which the values get stored is 16bit, how is this supposed
to work?


> but is 
> also used with smaller integers to efficiently encode audio blocks that 
> have redundancies in their LSBs (e.g. all zeros, all ones, etc.)

etc == duplicate some bit into all LSBs

the upscaling by adding 0 bits i can still understand but the other cases?
this seems like a senseless misdesign
is this used by any real files in the wild? if no then iam against supporting
it
if it is we dont have a choice but its ugly, the format could as well contain
a special case to store 0xDEADBEAF in the lsbs more efficiently


[...]
> @@ -344,6 +357,16 @@
>          }
>          pos = (pos + 1) & 7;
>          crc = crc * 3 + S;
> +
> +        if(s->sh_zeros)
> +            *dst++ = S << s->sh_zeros;
> +        else if(s->sh_ones)
> +            *dst++ = ((S + 1) << s->sh_ones) - 1;
> +        else if(s->sh_dups)
> +            *dst++ = ((S + (S & 1)) << s->sh_dups) - (S & 1);
> +        else
> +            *dst++ = S;
> +

bit = S & and | or;
*dst++= ((S+bit)<<shift)-bit;

with appropriate values for and,or,shift


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Observe your enemies, for they first find out your faults. -- Antisthenes
-------------- 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/20070805/15000596/attachment.pgp>



More information about the ffmpeg-devel mailing list