[Ffmpeg-devel] Re: [Ffmpeg-cvslog] CVS: ffmpeg/libavcodec dv.c, 1.72, 1.73
Roman Shaposhnick
rvs
Fri Feb 24 03:03:19 CET 2006
On Thu, Feb 23, 2006 at 09:56:55AM +0100, Michael Niedermayer CVS wrote:
> Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
> In directory mail:/var2/tmp/cvs-serv3315/libavcodec
>
> Modified Files:
> dv.c
> Log Message:
> fixing dv_guess_qnos()
> roman, dont hesitate to reverse this and solve it differntly if you want ...
I wish I could be as quick :-( Anyway, this looks almost exactly like what I
had in mind. Thanks for commiting it. A could of questions, though:
> } else {
> + if(b->next[k] >= mb_area_start[a+1] && b->next[k]<64){
> + for(a2=a+1; b->next[k] >= mb_area_start[a2+1]; a2++);
> + assert(a2<4);
> + assert(b->mb[b->next[k]]);
Why these particular asserts ?
> + b->bit_size[a2] += dv_rl2vlc_size(b->next[k] - prev - 1, b->mb[b->next[k]])
> + -dv_rl2vlc_size(b->next[k] - k - 1, b->mb[b->next[k]]);
> + }
> b->next[prev] = b->next[k];
> }
> }
> @@ -760,8 +767,26 @@
> }
> }
> }
> - } while ((vs_total_ac_bits < size[0] + size[1] + size[2] + size[3] + size[4]) &&
> - (qnos[0]|qnos[1]|qnos[2]|qnos[3]|qnos[4]));
> + if(vs_total_ac_bits >= size[0] + size[1] + size[2] + size[3] + size[4])
> + return;
> + } while (qnos[0]|qnos[1]|qnos[2]|qnos[3]|qnos[4]);
> +
> +
> + for(a=2; a==2 || vs_total_ac_bits < size[0]; a+=a){
> + b = blks;
> + size[0] = 0;
> + for (j=0; j<6*5; j++, b++) {
> + prev= b->prev[0];
> + for (k= b->next[prev]; k<64; k= b->next[k]) {
> + if(b->mb[k] < a && b->mb[k] > -a){
> + b->next[prev] = b->next[k];
> + }else{
> + size[0] += dv_rl2vlc_size(k - prev - 1, b->mb[k]);
> + prev= k;
> + }
> + }
> + }
> + }
Are you sure that we need this chunk of code ? My concern is -- in case
where encoder maxes out on all QNOs being 0s -- there's very little we
can to do salvage the situation anyway. Or did you have another idea
when creating this chunk of code ?
Thanks,
Roman.
More information about the ffmpeg-devel
mailing list