# HG changeset patch # User michael # Date 1084025745 0 # Node ID 8c7e7c332b862f4f6079c6f4ebf83c95d0bc9cc6 # Parent ad1a92c2db48d2ca1cf3e74c4a8574e5334267b8 using pointers so the code could eventually be used for P frames a few const modifiers to make gcc happier diff -r ad1a92c2db48 -r 8c7e7c332b86 svq1.c --- a/svq1.c Sat May 08 11:54:55 2004 +0000 +++ b/svq1.c Sat May 08 14:15:45 2004 +0000 @@ -67,6 +67,7 @@ AVCodecContext *avctx; DSPContext dsp; AVFrame picture; + AVFrame ref_picture[2]; PutBitContext pb; GetBitContext gb; @@ -1318,7 +1319,23 @@ int h= 2<<((level+1)>>1); int size=w*h; int16_t block[7][256]; - + const int intra= 1; + const int8_t *codebook_sum, *codebook; + const uint16_t (*mean_vlc)[2]; + const uint8_t (*multistage_vlc)[2]; + + if(intra){ + codebook_sum= svq1_intra_codebook_sum[level]; + codebook= svq1_intra_codebooks[level]; + mean_vlc= svq1_intra_mean_vlc; + multistage_vlc= svq1_intra_multistage_vlc[level]; + }else{ + codebook_sum= svq1_inter_codebook_sum[level]; + codebook= svq1_inter_codebooks[level]; + mean_vlc= svq1_inter_mean_vlc; + multistage_vlc= svq1_inter_multistage_vlc[level]; + } + best_score=0; for(y=0; yreorder_pb[level], - svq1_intra_multistage_vlc[level][1 + best_count][1], - svq1_intra_multistage_vlc[level][1 + best_count][0]); - put_bits(&s->reorder_pb[level], svq1_intra_mean_vlc[best_mean][1], - svq1_intra_mean_vlc[best_mean][0]); + multistage_vlc[1 + best_count][1], + multistage_vlc[1 + best_count][0]); + put_bits(&s->reorder_pb[level], mean_vlc[best_mean][1], + mean_vlc[best_mean][0]); for (i = 0; i < best_count; i++){ assert(best_vector[i]>=0 && best_vector[i]<16); @@ -1653,7 +1670,7 @@ *p = *pict; p->pict_type = I_TYPE; - p->key_frame = 1; + p->key_frame = p->pict_type == I_TYPE; svq1_write_header(s, p->pict_type); svq1_encode_plane(s, s->picture.data[0], s->frame_width, s->frame_height,