[FFmpeg-devel] Problem with imc

Benoit Fouet benoit.fouet
Fri Jul 16 12:31:53 CEST 2010


Hi,

while trying to have all tests up and running on a PPc Sam440ep board;
I encountered an issue with fate-imc test (oneoff):
stddev:28744.69 PSNR:  7.16 MAXDIFF:57645 bytes:   671232/   671232

After some investigations, it seems that float_to_int16 is not working
correctly on it. I tried a simple test with the diff below applied:

Index: libavcodec/imc.c
===================================================================
--- libavcodec/imc.c    (revision 24255)
+++ libavcodec/imc.c    (working copy)
@@ -654,6 +654,7 @@ static int imc_decode_frame(AVCodecConte
     int bits, summer;
     int counter, bitscount;
     uint16_t buf16[IMC_BLOCK_SIZE / 2];
+    int16_t *data16 = data;
 
     if (buf_size < IMC_BLOCK_SIZE) {
         av_log(avctx, AV_LOG_ERROR, "imc frame too small!\n");
@@ -805,7 +806,13 @@ static int imc_decode_frame(AVCodecConte
 
     imc_imdct256(q);
 
+#if 1
+    for (i = 0; i < COEFFS; i++) {
+       data16[i] = q->out_samples[i];
+    }
+#else
     q->dsp.float_to_int16(data, q->out_samples, COEFFS);
+#endif
 
     *data_size = COEFFS * sizeof(int16_t);

With that, the decoded sample can be understood. and the difference
between the x86 and the PPC is:
stddev:    1.16 PSNR: 94.99 MAXDIFF:  676 bytes:   671232/   671232

Ben



More information about the ffmpeg-devel mailing list