[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec vp3.c,1.43,1.44
Michael Niedermayer CVS
michael
Tue May 17 02:52:31 CEST 2005
Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
In directory mail:/var2/tmp/cvs-serv29184
Modified Files:
vp3.c
Log Message:
clear blocks after each idct instead of per picture
dont store the all zero coefficients of skiped blocks
Index: vp3.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/vp3.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- vp3.c 16 May 2005 21:49:18 -0000 1.43
+++ vp3.c 17 May 2005 00:52:29 -0000 1.44
@@ -135,7 +135,7 @@
#endif
typedef struct Vp3Fragment {
- DCTELEM coeffs[64];
+ DCTELEM *coeffs;
int coding_method;
int coeff_count;
int last_coeff;
@@ -246,6 +246,7 @@
int fragment_height;
Vp3Fragment *all_fragments;
+ DCTELEM *coeffs;
int u_fragment_start;
int v_fragment_start;
@@ -825,11 +826,12 @@
static void init_frame(Vp3DecodeContext *s, GetBitContext *gb)
{
int i;
+ static const DCTELEM zero_block[64];
/* zero out all of the fragment information */
s->coded_fragment_list_index = 0;
for (i = 0; i < s->fragment_count; i++) {
- memset(s->all_fragments[i].coeffs, 0, 64 * sizeof(DCTELEM));
+ s->all_fragments[i].coeffs = zero_block;
s->all_fragments[i].coeff_count = 0;
s->all_fragments[i].last_coeff = 0;
s->all_fragments[i].motion_x = 0xbeef;
@@ -1278,6 +1280,7 @@
* the next phase */
s->all_fragments[current_fragment].coding_method =
MODE_INTER_NO_MV;
+ s->all_fragments[current_fragment].coeffs= s->coeffs + 64*s->coded_fragment_list_index;
s->coded_fragment_list[s->coded_fragment_list_index] =
current_fragment;
if ((current_fragment >= s->u_fragment_start) &&
@@ -1307,6 +1310,7 @@
* coding will be determined in next step */
s->all_fragments[current_fragment].coding_method =
MODE_INTER_NO_MV;
+ s->all_fragments[current_fragment].coeffs= s->coeffs + 64*s->coded_fragment_list_index;
s->coded_fragment_list[s->coded_fragment_list_index] =
current_fragment;
if ((current_fragment >= s->u_fragment_start) &&
@@ -2187,6 +2191,7 @@
dequantizer,
s->all_fragments[i].coeff_count,
output_samples);
+ memset(s->all_fragments[i].coeffs, 0, 64*sizeof(DCTELEM));
if (s->all_fragments[i].coding_method == MODE_INTRA) {
s->dsp.put_signed_pixels_clamped(output_samples,
output_plane + s->all_fragments[i].first_pixel,
@@ -2542,6 +2547,7 @@
s->v_fragment_start);
s->all_fragments = av_malloc(s->fragment_count * sizeof(Vp3Fragment));
+ s->coeffs = av_malloc(s->fragment_count * sizeof(DCTELEM) * 64);
s->coded_fragment_list = av_malloc(s->fragment_count * sizeof(int));
s->pixel_addresses_inited = 0;
@@ -2809,6 +2815,7 @@
Vp3DecodeContext *s = avctx->priv_data;
av_free(s->all_fragments);
+ av_free(s->coeffs);
av_free(s->coded_fragment_list);
av_free(s->superblock_fragments);
av_free(s->superblock_macroblocks);
More information about the ffmpeg-cvslog
mailing list