[FFmpeg-devel] GSoC VQA v3 qualifying task, blocked , need input

The Deep Explorer thedeepexplorer
Mon Apr 13 05:52:47 CEST 2009


Hi,

In vqa_decode_chunk , I am trying to decode the vptr block.

The vptr block I assume is going to be decoded in the decode buffer.
Am I right in this ? or should I have to create another buffer ?

   if(vptr_chunk != -1) {
        chunk_size = AV_RB32(&s->buf[vptr_chunk + 4]);
        vptr_chunk += CHUNK_PREAMBLE_SIZE;
        getchar();
        vqa_decode_vptr(&s->buf[vptr_chunk], chunk_size,
            s->decode_buffer, s->decode_buffer_size);
    }

Is this correct ?

Next in the  vqa_decode_vptr , I am extracting the codes mentioned..I
am asking the questions
inside functions please let me know...

static void vqa_decode_vptr(const unsigned char *src, int src_size,
                            unsigned char *dest, int dest_size) {

    int src_index = 0;
    int dest_index = 0;
    short int code_buf = 0;
    short int code = 0;

    while(src_index < src_size) {
        memcpy(&code_buf,&src[src_index],2);
        code = code_buf >> 13;
        code = code & 0x0007;

        av_log(NULL,AV_LOG_ERROR,"Actual value of code %d Code Value
is %d \n",code_buf,code);
        switch(code) {

        case 0:
//            000 - Skip Count blocks. Count is (Val & 0x1fff).
              n = (code_buf & 0x1fff);

              where in which buffer am supposed to increase/skip
              by n ? the decode buffer or what ?
              dest_index += n;

              Is this what is it asking me to do ?

             av_log(NULL,AV_LOG_ERROR,"Code is 000 %d \n",code);
             break;

        case 1:

   /* 001 - Write block number (Val & 0xff) Count times.
             Count is (((Val/256) & 0x1f)+1)*2. Note that this can
             only index the first 256 blocks.
  */
// Vitor's advise ==> 001 - Write block number "idx" "k" times. idx =
(Val & 0xff) and k = (((Val/256) & 0x1f)+1)*2.
             idx = code_buf & 0xff
              k = (((Val/256) & 0x1f)+1)*2.

             so it will be like this ?
             for(index=0;index<k;index++)
                dest[dest_index+index] = idx;

Am not sure , please help...it is very much needed...

             av_log(NULL,AV_LOG_ERROR,"Code is 001 %d \n",code);
             break;
        case 2:
             av_log(NULL,AV_LOG_ERROR,"Code is 010 %d \n",code);
             break;
        case 3:
             av_log(NULL,AV_LOG_ERROR,"Code is 011 %d\n",code);
             break;
        case 5:
             av_log(NULL,AV_LOG_ERROR,"Code is 101 %d\n",code);
             break;
        default:
             av_log(NULL,AV_LOG_ERROR,"Code %d is unknown \n",code);
             break;
        }

   code = code_buf = 0;
    src_index += 2;
    av_log(NULL,AV_LOG_ERROR,"src_index  %d src_size = %d
\n",src_index,src_size);
    }
}

I apologize for so many questions....Look forward to your suggestions...
Thanks,
-tde



More information about the ffmpeg-devel mailing list