[FFmpeg-devel] GSoC VQA v3 vptr decode function implementation

The Deep Explorer thedeepexplorer
Mon Apr 13 09:04:45 CEST 2009


>> ? ? ? ? ? ?Kostya , you mentioned that memcpy is wrong , why ??
>> please elaborate...
>
> because you copy byte into some part of variable instead of proper
> assign. It will cause undefined because only part of variable is set
> (and it's different part on big and little-endian systems)
>

Agreed , and thanks for the explanation...I was actually setting the
variable to zero andf the copying so was expecting it to
work fine , but I guess the endian -ness will mess it up.

The modified code 5 -->

 case 5:
        /*101 - Write block (Val & 0x1fff) Count times. Count is the next
                 byte from the VPTR chunk.*/

             block_no = code_buf & 0x1ff;
             count = src[src_index+2];
             src_index++; // should I increase since I read it for the count ?
             for(index=0;index<count;index++)
                 dest[dest_index+index] = block_no;
             dest_index += index;
             av_log(NULL,AV_LOG_ERROR,"Code is 101 %d\n",code);
             break;

Is this correct ? or still way off base ?

Thanks,
-tde



More information about the ffmpeg-devel mailing list