[FFmpeg-devel] GSoC VQA v3 : input needed

The Deep Explorer thedeepexplorer
Wed Apr 8 10:17:10 CEST 2009

Hi All,
    I have done the cbfz , modified format80, catching the vptr , vprz
...I think these are trivial changes once the algorithm is clear..

Issue 1
however..I am still struggling with the vptr....please bear with me
and give some pointers...

" These chunks use some sort of differential, run-length algorithm that
  only records changes from the previous frame. Therefore, the previous
  frame bitmap must be maintained throughout all the frames (you could
  just draw the blocks that changed, though). This makes dropping frames
  (in case of bad performance) impossible. "

+ It talks about saving the previous frame , but where is the previous
frame used ? What form does the previous frames needs to be    stored

+ I understand the mechanism to decode the vptr , but do not
understand where to write the decoded vptr data ? e.g.
   001 - Write block number (Val & 0xff) Count times. ...so where do I
write that block "count" number of times ?

+ How is the decoded vptr being used to construct the frame ?

  "Every row of blocks is processed individually of others.
  When you encounter the end of a row, proceed to the next row
  (blocks are processed left to right, top to down).
  Repeat this process until all blocks in the frame are covered and
  that's it!"

It gives me the impression that vptr decoding itself is creating the
entire frame or does it create the index , I just cant
place the algorithm...some details please

Issue 2

In the vqa_decode_chunk, there is this portion of the code ...

  if (s->vector_height == 4)
        index_shift = 4;
        index_shift = 3;
    for (y = 0; y < s->frame.linesize[0] * s->height;
        y += s->frame.linesize[0] * s->vector_height) {

        for (x = y; x < y + s->width; x += 4, lobytes++, hibytes++) {
            pixel_ptr = x;

            /* get the vector index, the method for which varies according to
             * VQA file version */
            switch (s->vqa_version) {
                ...            case 3:
                                     /* not implemented yet */
                                     lines = 0;

===> So what is the algorithm for V3 , how do I find the vector index
? Is it related to decoding of the vptr if so how ?
         if not what is algo to find the vector index for v3 ?

Please help !!! I have read the document quite a number of times now :(

just adding to get some feedback if possible ...

+ cbfz changes ...

 if (cbfz_chunk != -1) {

        chunk_size = AV_RB32(&s->buf[cbfz_chunk + 4]);
        cbfz_chunk += CHUNK_PREAMBLE_SIZE;
        av_log(s->avctx, AV_LOG_ERROR, "  Chunk Size %d ",chunk_size);
	  i) for v1,v2
         ii) chunk size is less than 64KB
	 iii) the first byte is non null
	     then we still use the old format80
	if(s->vqa_version != 3 || chunk_size<64000 || AV_RB8(&s->buf[cbfz_chunk])){
        decode_format80(&s->buf[cbfz_chunk], chunk_size,
            s->codebook, s->codebook_size, 0, 0);
            decode_format80(&s->buf[cbfz_chunk], chunk_size,
               s->codebook, s->codebook_size, 0, 1);

+ vprz change

if(vprz_chunk != -1) {
        chunk_size = AV_RB32(&s->buf[vprz_chunk + 4]);
        vprz_chunk += CHUNK_PREAMBLE_SIZE;
        decode_format80(&s->buf[vprz_chunk], chunk_size,
            s->decode_buffer, s->decode_buffer_size, 1, 0);

+ decoding criterion changed

 /* decode the frame */
    if (vptz_chunk == -1 &&  vprz_chunk == -1  && vptr_chunk == -1 ) {

        av_log(s->avctx, AV_LOG_ERROR, "  VQA video: problem: vptz or
vprz or vptr missing \n");

The amount of code change seems quite less but the algorithm itself
seems quite tricky :((. I am getting worried now !!!

Look forward to the help.


More information about the ffmpeg-devel mailing list