[Ffmpeg-devel] Cook stereo (MONO_COOK2) bug and patch

Benjamin Larsson banan
Mon Jan 29 09:42:06 CET 2007


Ian Braithwaite wrote:

>Hi
>
>
>On Sun, January 21, 2007 17:50, Michael Niedermayer wrote:
>
>  
>
>>i was more thinking of something like:
>>
>>int shift= (uint32_t)inbuffer & 3;
>>uint32_t *buf =  inbuffer - shift;
>>uint32_t *obuf= outbuffer;
>>uint32_t c= be2me_32((0x37c511f2>>(shift*8)) |
>>(0x37c511f2<<(32-(shift*8))));
>>bytes += 3+shift;
>>for(i=0; i<bytes; i++)
>>    obuf[i] = c^buf[i];
>>
>>return shift;
>>
>>and check that the outbuffer is allocated large enough for this ...
>>    
>>
>
>OK, thanks for spelling it out.
>Done.
>
>
>  
>
>>the remainder of patch 1 looks ok
>>    
>>
>
>Great.
>
>
>  
>
>>>+    /* Swap current and previous gains */
>>>+    tmp = gain_ptr[0];
>>>+    gain_ptr[0] = gain_ptr[1];
>>>+    gain_ptr[1] = tmp;
>>>      
>>>
>>FFSWAP()
>>    
>>
>
>Done.
>
>
>  
>
>>>+    /* Clip and convert floats to 16 bits.
>>>+     */
>>>+    for (j = 0; j < q->samples_per_frame; j++) {
>>>+        value = lrintf(q->mono_mdct_output[j]);
>>>+        if (value < -32768) value = -32768;
>>>+        else if (value > 32767) value = 32767;
>>>      
>>>
>>clip()
>>    
>>
>
>Done.
>
>
>  
>
>>also note that Benjamin Larsson is maintainer of cook* so his oppinion is
>>what matters (especially for patch 2 which looks nice but i didnt check
>>that it is correct, as benjamin can probably do this quicker then me ...)
>>    
>>
>
>Sure.
>
>
>Cheers,
>Ian
>  
>
>------------------------------------------------------------------------
>

Applied both patches, thanks for your work.

MvH
Benjamin Larsson

-- 
new tiny signature





More information about the ffmpeg-devel mailing list