[FFmpeg-devel] GSoC VQA v3 vptr decode function implementation
Mon Apr 13 08:34:10 CEST 2009
On Mon, Apr 13, 2009 at 8:31 AM, The Deep Explorer
<thedeepexplorer at gmail.com> wrote:
>> You have Count bytes to read and those are indexes for Count blocks,
>> so each index takes Count / Count = 1 byte
>>> So, count is ?(((Val/256) & 0x1f)+1)*2 ?and then this many times we
>>> will have to read/fetch
>>> each byte from the vptr chunk.. the byte we read is the index of what ?
>> of next block
>>> Is it the index to the dest buffer where we are writing the block no ?
>>> And every time we read , we have to increment the src index pointer by 1 byte ?
>> of course
> Summarize :
> First I write block no ?(code_buf & 0xff)
> Second count is (((code_buf/256) & 0x1f)+1)*2 ?and this is the number
> of times I read 1 byte from the vptr chunk and
> every time I increment the index.
> The value of the bye am reading is the index to the next block , what
> block is this ?? This is where I get lost.
> Please clarify. Where do I have to write this ?
> Also, can anyone please tell me whether the following code 5 is correct or not ?
> ?case 5:
> ? ? ? ?/*101 - Write block (Val & 0x1fff) Count times. Count is the next
> ? ? ? ? ? ? ? ? byte from the VPTR chunk.*/
> ? ? ? ? ? ? block_no = code_buf & 0x1ff;
> ? ? ? ? ? ? memcpy(&count,&src[src_index+2],1);
memcpy() here is plainly wrong.
> ? ? ? ? ? ? src_index++; // should I increase since I read it for the count ?
> ? ? ? ? ? ? for(index=0;index<count;index++)
> ? ? ? ? ? ? ? ? dest[dest_index+index] = block_no;
for case 2 it would be dest[dest_index+index] = src[src_index+index]
> ? ? ? ? ? ? dest_index += index;
> ? ? ? ? ? ? av_log(NULL,AV_LOG_ERROR,"Code is 101 %d\n",code);
> ? ? ? ? ? ? break;
More information about the ffmpeg-devel