[FFmpeg-devel] [PATCH 01/N] RV30/40 Decoder - Core

Kostya kostya.shishkov
Sun Dec 16 14:43:54 CET 2007


On Sun, Dec 16, 2007 at 02:13:16AM +0100, Michael Niedermayer wrote:
> [...]
> >     int c_index = avail_index - 4 + c_off;
> > 
> >     mv_pos += (subblock_no & 1) + (subblock_no >> 1)*s->b8_stride;
> 
> >     if(block_type == RV34_MB_P_8x8 && subblock_no == 3){
> 
> the block_type == RV34_MB_P_8x8 check is unneeded, there should be no others
> which have subblock_no == 3

right 
 
> >         c_off = -1;
> >         c_index = avail_index - 5;
> >     }
> > 
> >     if(r->avail_cache[avail_index - 1]){
> >         A[0] = s->current_picture_ptr->motion_val[0][mv_pos-1][0];
> >         A[1] = s->current_picture_ptr->motion_val[0][mv_pos-1][1];
> >     }
> >     if(r->avail_cache[avail_index - 4]){
> >         B[0] = s->current_picture_ptr->motion_val[0][mv_pos-s->b8_stride][0];
> >         B[1] = s->current_picture_ptr->motion_val[0][mv_pos-s->b8_stride][1];
> >     }else{
> >         B[0] = A[0];
> >         B[1] = A[1];
> >     }
> 
> >     if(!r->avail_cache[c_index]){
> 
> c_index here can be replaced by avail_index - 4 + c_off and all other
> c_index can be removed

done
 
> [...]
> >     ff_init_block_index(s);
> >     while(!check_slice_end(r, s)) {
> >         ff_update_block_index(s);
> >         s->dsp.clear_blocks(s->block[0]);
> > 
> >         if(rv34_decode_macroblock(r, r->intra_types + s->mb_x * 4 + 1) < 0)
> >             break;
> >         if (++s->mb_x == s->mb_width) {
> >             s->mb_x = 0;
> >             s->mb_y++;
> >             ff_init_block_index(s);
> > 
> >             memmove(r->intra_types_hist, r->intra_types, s->b4_stride * 4 * sizeof(*r->intra_types_hist));
> >             memset(r->intra_types, -1, s->b4_stride * 4 * sizeof(*r->intra_types_hist));
> >         }
> >         if(s->mb_x == s->resync_mb_x)
> >             s->first_slice_line=0;
> >         s->mb_num_left--;
> >     }
> >     if(s->mb_y >= s->mb_height && s->mb_x){
> >         ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, AC_ERROR|DC_ERROR|MV_ERROR);
> >         return 1;
> >     }
> >     ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, AC_END|DC_END|MV_END);
> 
> this is not correct, EVERY error must be added properly
> these are
> missmatches of the block end and bitstream end
> error returns from rv34_decode_macroblock()
> 
> 
> [...]
> 
> after you took care of the above, got rid of the mc_dir_part() duplication,
> mb_type-avail_cache simplification and anything ive missed ...
> you can commit it

Fixed spotted things, mc_dir_part() analog is different from both H.264 and SVQ3
so I left it for now. It will be touched during 1/3 pel MC implementing anyway.

I'm not enabling decoders now as they need more work and I don't want to see
a flood of mails about it.

> PS: id like to see a patch for the loopfilter, 1/3 pel MC and any other major
> improvments instead of direct commits (unless the code you commit is really
> clean, simplified, fast and free of duplications)

I intended to do it this way. 
 
> [...]
> -- 
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB




More information about the ffmpeg-devel mailing list