[FFmpeg-devel] GSoC VQA v3 vptr decode function implementation
Kostya Shishkov
kostya.shishkov
Mon Apr 13 08:58:45 CEST 2009
On Mon, Apr 13, 2009 at 8:53 AM, The Deep Explorer
<thedeepexplorer at gmail.com> wrote:
> Hi ,
> ? ?I am explaining my logic behind code 5 implementation :
>
> ? ?case 5:
> ? ? ? ?/*101 - Write block (Val & 0x1fff) Count times. Count is the next
> ? ? ? ? ? ? ? ? byte from the VPTR chunk.*/
> ? ? ? ? ? a) first am computing block
> ? ? ? ? ? ?block_no = code_buf & 0x1ff;
> ? ? ? ? ? b) I am reading the next byte from the vptr chunk ....
> ? ? ? ? ? ?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)
> ? ? ? ? ? ? memcpy(&count,&src[src_index+2],1);
> ? ? ? ? ? ? src_index++; // Am increasing by 1 byte and later outside
> the switch in the loop incremeneting by ?2 bytes ...
>
> ? // Writing the block "count times "
> ? ? ? ? ? ? for(index=0;index<count;index++)
> ? ? ? ? ? ? ? ? dest[dest_index+index] = block_no;
> // Then updating the destination index for good...
> ? ? ? ? ?dest_index += index;
> ? ? ? ? ? ? av_log(NULL,AV_LOG_ERROR,"Code is 101 %d\n",code);
> ? ? ? ? ? ? break;
>
>
> Please tell me where am I going wrong ? WHat needs to be fixed for
> this snippet of code ?
>
> Thanks,
> -tde
More information about the ffmpeg-devel
mailing list