[FFmpeg-soc] [soc]: r1371 - in rv40: rv40.c rv40data.h rv40vlc.h

kostya subversion at mplayerhq.hu
Mon Sep 17 19:22:37 CEST 2007


Author: kostya
Date: Mon Sep 17 19:22:37 2007
New Revision: 1371

Log:
Set prefix to rv34_ for common variables (and RV34 for defines)

Modified:
   rv40/rv40.c
   rv40/rv40data.h
   rv40/rv40vlc.h

Modified: rv40/rv40.c
==============================================================================
--- rv40/rv40.c	(original)
+++ rv40/rv40.c	Mon Sep 17 19:22:37 2007
@@ -38,30 +38,30 @@
 //#define DEBUG
 
 /** Translation of RV40 macroblock types to lavc ones */
-static const int rv40_mb_type_to_lavc[12] = {
+static const int rv34_mb_type_to_lavc[12] = {
     MB_TYPE_INTRA, MB_TYPE_INTRA16x16, MB_TYPE_16x16,   MB_TYPE_8x8,
     MB_TYPE_16x16, MB_TYPE_16x16,      MB_TYPE_SKIP,    MB_TYPE_DIRECT2,
     MB_TYPE_16x8,  MB_TYPE_8x16,       MB_TYPE_DIRECT2, MB_TYPE_16x16
 };
 
 /**
- * RV40 Macroblock types
+ * RV30 and RV40 Macroblock types
  * @{
  */
 enum RV40BlockTypes{
-    RV40_MB_TYPE_INTRA,      ///< Intra macroblock
-    RV40_MB_TYPE_INTRA16x16, ///< Intra macroblock with DCs in a separate 4x4 block
-    RV40_MB_P_16x16,         ///< P-frame macroblock, one motion frame
-    RV40_MB_P_8x8,           ///< P-frame macroblock, 8x8 motion compensation partitions
-    RV40_MB_B_FORWARD,       ///< B-frame macroblock, forward prediction
-    RV40_MB_B_BACKWARD,      ///< B-frame macroblock, backward prediction
-    RV40_MB_SKIP,            ///< Skipped block
-    RV40_MB_B_INTERP,        ///< Bidirectionally predicted B-frame macroblock, no motion vectors
-    RV40_MB_P_16x8,          ///< P-frame macroblock, 16x8 motion compensation partitions
-    RV40_MB_P_8x16,          ///< P-frame macroblock, 8x16 motion compensation partitions
-    RV40_MB_B_DIRECT,        ///< Bidirectionally predicted B-frame macroblock, two motion vectors
-    RV40_MB_P_MIX16x16,      ///< P-frame macroblock with DCs in a separate 4x4 block, one motion vector
-    RV40_MB_TYPES
+    RV34_MB_TYPE_INTRA,      ///< Intra macroblock
+    RV34_MB_TYPE_INTRA16x16, ///< Intra macroblock with DCs in a separate 4x4 block
+    RV34_MB_P_16x16,         ///< P-frame macroblock, one motion frame
+    RV34_MB_P_8x8,           ///< P-frame macroblock, 8x8 motion compensation partitions
+    RV34_MB_B_FORWARD,       ///< B-frame macroblock, forward prediction
+    RV34_MB_B_BACKWARD,      ///< B-frame macroblock, backward prediction
+    RV34_MB_SKIP,            ///< Skipped block
+    RV34_MB_B_INTERP,        ///< Bidirectionally predicted B-frame macroblock, no motion vectors
+    RV34_MB_P_16x8,          ///< P-frame macroblock, 16x8 motion compensation partitions
+    RV34_MB_P_8x16,          ///< P-frame macroblock, 8x16 motion compensation partitions
+    RV34_MB_B_DIRECT,        ///< Bidirectionally predicted B-frame macroblock, two motion vectors
+    RV34_MB_P_MIX16x16,      ///< P-frame macroblock with DCs in a separate 4x4 block, one motion vector
+    RV34_MB_TYPES
 };
 /** @} */
 
@@ -70,14 +70,14 @@ enum RV40BlockTypes{
  *
  * intra frame VLC sets do not contain some of those tables
  */
-typedef struct RV40VLC{
+typedef struct RV34VLC{
     VLC cbppattern[2];     ///< VLCs used for pattern of coded block patterns decoding
     VLC cbp[2][4];         ///< VLCs used for coded block patterns decoding
     VLC first_pattern[4];  ///< VLCs used for decoding coefficients in the first subblock
     VLC second_pattern[2]; ///< VLCs used for decoding coefficients in the subblocks 2 and 3
     VLC third_pattern[2];  ///< VLCs used for decoding coefficients in the last subblock
     VLC coefficient;       ///< VLCs used for decoding big coefficients
-}RV40VLC;
+}RV34VLC;
 
 /** Essential slice information */
 typedef struct SliceInfo{
@@ -100,7 +100,7 @@ typedef struct SavedSliceInfo{
 }SavedSliceInfo;
 
 /** Decoder context */
-typedef struct RV40DecContext{
+typedef struct RV34DecContext{
     MpegEncContext s;
     int mb_bits;             ///< bits needed to read MB offet in slice header
     int *intra_types_hist;   ///< old block types, used for prediction
@@ -109,7 +109,7 @@ typedef struct RV40DecContext{
     int block_start;         ///< start of slice in blocks
 
     int vlc_set;             ///< index of currently selected VLC set
-    RV40VLC *cur_vlcs;       ///< VLC set used for current frame decoding
+    RV34VLC *cur_vlcs;       ///< VLC set used for current frame decoding
     int bits;                ///< slice size in bits
     H264PredContext h;       ///< functions for 4x4 and 16x16 intra block prediction
     SliceInfo si;            ///< current slice information
@@ -130,9 +130,9 @@ typedef struct RV40DecContext{
     int rpr;                 ///< one field size in RV30 slice header
 
     int avail[4];            ///< whether left, top, top rights and top left MBs are available
-}RV40DecContext;
+}RV34DecContext;
 
-static RV40VLC intra_vlcs[NUM_INTRA_TABLES], inter_vlcs[NUM_INTER_TABLES];
+static RV34VLC intra_vlcs[NUM_INTRA_TABLES], inter_vlcs[NUM_INTER_TABLES];
 static VLC aic_top_vlc;
 static VLC aic_mode1_vlc[AIC_MODE1_NUM], aic_mode2_vlc[AIC_MODE2_NUM];
 static VLC mbinfo_vlc, ptype_vlc[NUM_PTYPE_VLCS], btype_vlc[NUM_BTYPE_VLCS];
@@ -145,7 +145,7 @@ static VLC mbinfo_vlc, ptype_vlc[NUM_PTY
 /**
  * Generate VLC from codeword lengths
  */
-static int rv40_gen_vlc(const uint8_t *bits2, int size, VLC *vlc)
+static int rv34_gen_vlc(const uint8_t *bits2, int size, VLC *vlc)
 {
     int i;
     int counts[17] = {0}, codes[17];
@@ -182,36 +182,36 @@ static int rv40_gen_vlc(const uint8_t *b
 /**
  * Initialize all tables
  */
-static void rv40_init_tables()
+static void rv34_init_tables()
 {
     int i, j, k;
 
     for(i = 0; i < NUM_INTRA_TABLES; i++){
         for(j = 0; j < 2; j++)
-            rv40_gen_vlc(rv40_intra_cbppatvlc_pointers[i][j], CBPPAT_VLC_SIZE, &intra_vlcs[i].cbppattern[j]);
+            rv34_gen_vlc(rv34_intra_cbppatvlc_pointers[i][j], CBPPAT_VLC_SIZE, &intra_vlcs[i].cbppattern[j]);
         for(j = 0; j < 2; j++)
             for(k = 0; k < 4; k++)
-                rv40_gen_vlc(rv40_intra_cbpvlc_pointers[i][j][k], CBP_VLC_SIZE, &intra_vlcs[i].cbp[j][k]);
+                rv34_gen_vlc(rv34_intra_cbpvlc_pointers[i][j][k], CBP_VLC_SIZE, &intra_vlcs[i].cbp[j][k]);
         for(j = 0; j < 4; j++)
-            rv40_gen_vlc(rv40_intra_firstpatvlc_pointers[i][j], FIRSTBLK_VLC_SIZE, &intra_vlcs[i].first_pattern[j]);
+            rv34_gen_vlc(rv34_intra_firstpatvlc_pointers[i][j], FIRSTBLK_VLC_SIZE, &intra_vlcs[i].first_pattern[j]);
         for(j = 0; j < 2; j++)
-            rv40_gen_vlc(rv40_intra_secondpatvlc_pointers[i][j], OTHERBLK_VLC_SIZE, &intra_vlcs[i].second_pattern[j]);
+            rv34_gen_vlc(rv34_intra_secondpatvlc_pointers[i][j], OTHERBLK_VLC_SIZE, &intra_vlcs[i].second_pattern[j]);
         for(j = 0; j < 2; j++)
-            rv40_gen_vlc(rv40_intra_thirdpatvlc_pointers[i][j], OTHERBLK_VLC_SIZE, &intra_vlcs[i].third_pattern[j]);
-        rv40_gen_vlc(rv40_intra_coeffvlc_pointers[i], COEFF_VLC_SIZE, &intra_vlcs[i].coefficient);
+            rv34_gen_vlc(rv34_intra_thirdpatvlc_pointers[i][j], OTHERBLK_VLC_SIZE, &intra_vlcs[i].third_pattern[j]);
+        rv34_gen_vlc(rv34_intra_coeffvlc_pointers[i], COEFF_VLC_SIZE, &intra_vlcs[i].coefficient);
     }
 
     for(i = 0; i < NUM_INTER_TABLES; i++){
-        rv40_gen_vlc(rv40_inter_cbppatvlc_pointers[i], CBPPAT_VLC_SIZE, &inter_vlcs[i].cbppattern[0]);
+        rv34_gen_vlc(rv34_inter_cbppatvlc_pointers[i], CBPPAT_VLC_SIZE, &inter_vlcs[i].cbppattern[0]);
         for(j = 0; j < 4; j++)
-            rv40_gen_vlc(rv40_inter_cbpvlc_pointers[i][j], CBP_VLC_SIZE, &inter_vlcs[i].cbp[0][j]);
+            rv34_gen_vlc(rv34_inter_cbpvlc_pointers[i][j], CBP_VLC_SIZE, &inter_vlcs[i].cbp[0][j]);
         for(j = 0; j < 2; j++)
-            rv40_gen_vlc(rv40_inter_firstpatvlc_pointers[i][j], FIRSTBLK_VLC_SIZE, &inter_vlcs[i].first_pattern[j]);
+            rv34_gen_vlc(rv34_inter_firstpatvlc_pointers[i][j], FIRSTBLK_VLC_SIZE, &inter_vlcs[i].first_pattern[j]);
         for(j = 0; j < 2; j++)
-            rv40_gen_vlc(rv40_inter_secondpatvlc_pointers[i][j], OTHERBLK_VLC_SIZE, &inter_vlcs[i].second_pattern[j]);
+            rv34_gen_vlc(rv34_inter_secondpatvlc_pointers[i][j], OTHERBLK_VLC_SIZE, &inter_vlcs[i].second_pattern[j]);
         for(j = 0; j < 2; j++)
-            rv40_gen_vlc(rv40_inter_thirdpatvlc_pointers[i][j], OTHERBLK_VLC_SIZE, &inter_vlcs[i].third_pattern[j]);
-        rv40_gen_vlc(rv40_inter_coeffvlc_pointers[i], COEFF_VLC_SIZE, &inter_vlcs[i].coefficient);
+            rv34_gen_vlc(rv34_inter_thirdpatvlc_pointers[i][j], OTHERBLK_VLC_SIZE, &inter_vlcs[i].third_pattern[j]);
+        rv34_gen_vlc(rv34_inter_coeffvlc_pointers[i], COEFF_VLC_SIZE, &inter_vlcs[i].coefficient);
     }
 
     init_vlc(&aic_top_vlc, AIC_TOP_BITS, AIC_TOP_SIZE,
@@ -259,7 +259,7 @@ static void rv40_init_tables()
  * Real Video 4.0 inverse transform
  * Code is almost the same as in SVQ3, only scaling is different
  */
-static void rv40_intra_inv_transform(DCTELEM *block, const int offset){
+static void rv34_intra_inv_transform(DCTELEM *block, const int offset){
     int temp[16];
     unsigned int i;
 
@@ -295,7 +295,7 @@ static void rv40_intra_inv_transform(DCT
  * Code is almost the same but final coefficients are multiplied by 1.5
  * and have no rounding
  */
-static void rv40_intra_inv_transform_noround(DCTELEM *block, const int offset){
+static void rv34_intra_inv_transform_noround(DCTELEM *block, const int offset){
     int temp[16];
     unsigned int i;
 
@@ -336,7 +336,7 @@ static void rv40_intra_inv_transform_nor
 /**
  * Decode coded block pattern
  */
-static int rv40_decode_cbp(GetBitContext *gb, RV40VLC *vlc, int table)
+static int rv34_decode_cbp(GetBitContext *gb, RV34VLC *vlc, int table)
 {
     int pattern, code, cbp=0;
     int table2;
@@ -349,12 +349,12 @@ static int rv40_decode_cbp(GetBitContext
     pattern = code & 0xF;
     code >>= 4;
 
-    table2 = rv40_count_ones[pattern];
+    table2 = rv34_count_ones[pattern];
 
     for(mask = 8; mask; mask >>= 1, curshift++){
         if(!(pattern & mask)) continue;
         t = get_vlc2(gb, vlc->cbp[table][table2].table, vlc->cbp[table][table2].bits, 1);
-        cbp |= rv40_cbp_code[t] << curshift[0];
+        cbp |= rv34_cbp_code[t] << curshift[0];
     }
 
     for(i = 0; i < 4; i++){
@@ -420,7 +420,7 @@ static inline void decode_subblock(DCTEL
  *  o--o
  */
 
-static inline void rv40_decode_block(DCTELEM *dst, GetBitContext *gb, RV40VLC *rvlc, int fc, int sc)
+static inline void rv34_decode_block(DCTELEM *dst, GetBitContext *gb, RV34VLC *rvlc, int fc, int sc)
 {
     int code, pattern;
 
@@ -449,7 +449,7 @@ static inline void rv40_decode_block(DCT
  * Dequantize ordinary 4x4 block
  * @todo optimize
  */
-static inline void rv40_dequant4x4(DCTELEM *block, int offset, int Qdc, int Q)
+static inline void rv34_dequant4x4(DCTELEM *block, int offset, int Qdc, int Q)
 {
     int i, j;
 
@@ -464,15 +464,15 @@ static inline void rv40_dequant4x4(DCTEL
  * Dequantize 4x4 block of DC values for 16x16 macroblock
  * @todo optimize
  */
-static inline void rv40_dequant4x4_16x16(DCTELEM *block, int offset, int Qdc, int Q)
+static inline void rv34_dequant4x4_16x16(DCTELEM *block, int offset, int Qdc, int Q)
 {
     int i;
 
     block += offset;
     for(i = 0; i < 3; i++)
-         block[rv40_dezigzag[i]] = (block[rv40_dezigzag[i]] * Qdc + 8) >> 4;
+         block[rv34_dezigzag[i]] = (block[rv34_dezigzag[i]] * Qdc + 8) >> 4;
     for(; i < 16; i++)
-         block[rv40_dezigzag[i]] = (block[rv40_dezigzag[i]] * Q + 8) >> 4;
+         block[rv34_dezigzag[i]] = (block[rv34_dezigzag[i]] * Q + 8) >> 4;
 }
 /** @} */ //block functions
 
@@ -524,7 +524,7 @@ static void rv40_parse_picture_size(GetB
 /**
  * Select VLC set for decoding from current quantizer, modifier and frame type
  */
-static inline RV40VLC* choose_vlc_set(int quant, int mod, int type)
+static inline RV34VLC* choose_vlc_set(int quant, int mod, int type)
 {
     if(mod == 2){
         if(quant < 19) quant += 10;
@@ -532,11 +532,11 @@ static inline RV40VLC* choose_vlc_set(in
     }
     if(mod == 1)
         if(quant < 26) quant += 5;
-    return type ? &inter_vlcs[rv40_quant_to_vlc_set[1][av_clip(quant, 0, 30)]]
-                : &intra_vlcs[rv40_quant_to_vlc_set[0][av_clip(quant, 0, 30)]];
+    return type ? &inter_vlcs[rv34_quant_to_vlc_set[1][av_clip(quant, 0, 30)]]
+                : &intra_vlcs[rv34_quant_to_vlc_set[0][av_clip(quant, 0, 30)]];
 }
 
-static int rv30_parse_slice_header(RV40DecContext *r, GetBitContext *gb, SliceInfo *si)
+static int rv30_parse_slice_header(RV34DecContext *r, GetBitContext *gb, SliceInfo *si)
 {
     int t, mb_bits;
     int w = r->s.width, h = r->s.height;
@@ -557,16 +557,16 @@ static int rv30_parse_slice_header(RV40D
     si->height = h;
     mb_size = ((w + 15) >> 4) * ((h + 15) >> 4);
     for(i = 0; i < 5; i++)
-        if(rv40_mb_max_sizes[i] > mb_size)
+        if(rv34_mb_max_sizes[i] > mb_size)
             break;
-    mb_bits = rv40_mb_bits_sizes[i];
+    mb_bits = rv34_mb_bits_sizes[i];
     si->start = get_bits(gb, mb_bits);
     get_bits1(gb);
     si->header_size = get_bits_count(gb);
     return 0;
 }
 
-static int rv40_parse_slice_header(RV40DecContext *r, GetBitContext *gb, SliceInfo *si)
+static int rv40_parse_slice_header(RV34DecContext *r, GetBitContext *gb, SliceInfo *si)
 {
     int t, mb_bits;
     int w = r->s.width, h = r->s.height;
@@ -590,9 +590,9 @@ static int rv40_parse_slice_header(RV40D
     si->height = h;
     mb_size = ((w + 15) >> 4) * ((h + 15) >> 4);
     for(i = 0; i < 5; i++)
-        if(rv40_mb_max_sizes[i] > mb_size)
+        if(rv34_mb_max_sizes[i] > mb_size)
             break;
-    mb_bits = rv40_mb_bits_sizes[i];
+    mb_bits = rv34_mb_bits_sizes[i];
     si->start = get_bits(gb, mb_bits);
     si->header_size = get_bits_count(gb);
 
@@ -640,7 +640,7 @@ static inline int get_omega_signed(GetBi
 /**
  * Decode 4x4 intra types array
  */
-static int rv30_decode_intra_types(RV40DecContext *r, GetBitContext *gb, int *dst)
+static int rv30_decode_intra_types(RV34DecContext *r, GetBitContext *gb, int *dst)
 {
     int i, j, k;
     int A, B;
@@ -672,7 +672,7 @@ static int rv30_decode_intra_types(RV40D
 /**
  * Decode 4x4 intra types array
  */
-static int rv40_decode_intra_types(RV40DecContext *r, GetBitContext *gb, int *dst)
+static int rv40_decode_intra_types(RV34DecContext *r, GetBitContext *gb, int *dst)
 {
     MpegEncContext *s = &r->s;
     int i, j, k, v;
@@ -735,10 +735,10 @@ static int rv40_decode_intra_types(RV40D
 /**
  * Decode quantizer difference and return modified quantizer
  */
-static inline int rv40_decode_dquant(GetBitContext *gb, int quant)
+static inline int rv34_decode_dquant(GetBitContext *gb, int quant)
 {
     if(get_bits1(gb))
-        return av_clip(quant + rv40_dquant_tab[quant * 2 + get_bits1(gb)], 0, 31);
+        return av_clip(quant + rv34_dquant_tab[quant * 2 + get_bits1(gb)], 0, 31);
     else
         return get_bits(gb, 5);
 }
@@ -746,10 +746,10 @@ static inline int rv40_decode_dquant(Get
 /**
  * Decode macroblock information
  */
-static int rv30_decode_mb_info(RV40DecContext *r)
+static int rv30_decode_mb_info(RV34DecContext *r)
 {
-    static const int rv30_p_types[6] = { RV40_MB_SKIP, RV40_MB_P_16x16, RV40_MB_P_8x8, -1, RV40_MB_TYPE_INTRA, RV40_MB_TYPE_INTRA16x16 };
-    static const int rv30_b_types[6] = { RV40_MB_SKIP, RV40_MB_B_INTERP, RV40_MB_B_FORWARD, RV40_MB_B_BACKWARD, RV40_MB_TYPE_INTRA, RV40_MB_TYPE_INTRA16x16 };
+    static const int rv30_p_types[6] = { RV34_MB_SKIP, RV34_MB_P_16x16, RV34_MB_P_8x8, -1, RV34_MB_TYPE_INTRA, RV34_MB_TYPE_INTRA16x16 };
+    static const int rv30_b_types[6] = { RV34_MB_SKIP, RV34_MB_B_INTERP, RV34_MB_B_FORWARD, RV34_MB_B_BACKWARD, RV34_MB_TYPE_INTRA, RV34_MB_TYPE_INTRA16x16 };
     MpegEncContext *s = &r->s;
     GetBitContext *gb = &s->gb;
     int code;
@@ -772,21 +772,21 @@ static int rv30_decode_mb_info(RV40DecCo
 /**
  * Decode macroblock information
  */
-static int rv40_decode_mb_info(RV40DecContext *r)
+static int rv40_decode_mb_info(RV34DecContext *r)
 {
     MpegEncContext *s = &r->s;
     GetBitContext *gb = &s->gb;
     int q, i;
     int prev_type = 0;
     int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
-    int blocks[RV40_MB_TYPES];
+    int blocks[RV34_MB_TYPES];
     int count = 0;
 
     if(!r->s.mb_skip_run)
         r->s.mb_skip_run = get_omega(gb);
 
     if(--r->s.mb_skip_run)
-         return RV40_MB_SKIP;
+         return RV34_MB_SKIP;
 
     memset(blocks, 0, sizeof(blocks));
     if(r->avail[0])
@@ -798,14 +798,14 @@ static int rv40_decode_mb_info(RV40DecCo
     if(r->avail[1] && r->avail[3])
         blocks[r->mb_type[mb_pos - s->mb_stride - 1]]++;
 
-    for(i = 0; i < RV40_MB_TYPES; i++){
+    for(i = 0; i < RV34_MB_TYPES; i++){
         if(blocks[i] > count){
             count = blocks[i];
             prev_type = i;
         }
     }
     if(s->pict_type == P_TYPE){
-        if(prev_type == RV40_MB_SKIP) prev_type = RV40_MB_P_16x16;
+        if(prev_type == RV34_MB_SKIP) prev_type = RV34_MB_P_16x16;
         prev_type = block_num_to_ptype_vlc_num[prev_type];
         q = get_vlc2(gb, ptype_vlc[prev_type].table, PTYPE_VLC_BITS, 1);
         if(q < PBTYPE_ESCAPE)
@@ -831,10 +831,10 @@ static int rv40_decode_mb_info(RV40DecCo
  */
 
 /** Macroblock partition width in 8x8 blocks */
-static const uint8_t part_sizes_w[RV40_MB_TYPES] = { 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 2, 2 };
+static const uint8_t part_sizes_w[RV34_MB_TYPES] = { 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 2, 2 };
 
 /** Macroblock partition height in 8x8 blocks */
-static const uint8_t part_sizes_h[RV40_MB_TYPES] = { 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2 };
+static const uint8_t part_sizes_h[RV34_MB_TYPES] = { 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2 };
 
 /**
  * Motion vectors prediction
@@ -843,7 +843,7 @@ static const uint8_t part_sizes_h[RV40_M
  * motion vector from the left, top and right top blocks but in corener cases
  * some other vectors may be used instead
  */
-static void rv40_pred_mv(RV40DecContext *r, int block_type, int subblock_no)
+static void rv34_pred_mv(RV34DecContext *r, int block_type, int subblock_no)
 {
     MpegEncContext *s = &r->s;
     int mv_pos = s->mb_x * 2 + s->mb_y * 2 * s->b8_stride;
@@ -859,14 +859,14 @@ static void rv40_pred_mv(RV40DecContext 
     no_B = !r->avail[1];
     no_C = !r->avail[2];
     switch(block_type){
-    case RV40_MB_P_16x16:
-    case RV40_MB_P_MIX16x16:
+    case RV34_MB_P_16x16:
+    case RV34_MB_P_MIX16x16:
         if(!no_C){
             C[0] = s->current_picture_ptr->motion_val[0][mv_pos-s->b8_stride+2][0];
             C[1] = s->current_picture_ptr->motion_val[0][mv_pos-s->b8_stride+2][1];
         }
         break;
-    case RV40_MB_P_8x8:
+    case RV34_MB_P_8x8:
         mv_pos += (subblock_no & 1) + (subblock_no >> 1)*s->b8_stride;
         if(subblock_no & 1) no_A = 0;
         if(subblock_no & 2) no_B = 0;
@@ -883,7 +883,7 @@ static void rv40_pred_mv(RV40DecContext 
             C[1] = s->current_picture_ptr->motion_val[0][mv_pos-s->b8_stride-1][1];
         }
         break;
-    case RV40_MB_P_16x8:
+    case RV34_MB_P_16x8:
         mv_pos += subblock_no*s->b8_stride;
         no_B &= ~subblock_no;
         no_C |= subblock_no;
@@ -892,7 +892,7 @@ static void rv40_pred_mv(RV40DecContext 
             C[1] = s->current_picture_ptr->motion_val[0][mv_pos-s->b8_stride+2][1];
         }
         break;
-    case RV40_MB_P_8x16:
+    case RV34_MB_P_8x16:
         mv_pos += subblock_no;
         no_A &= ~subblock_no;
         if(!subblock_no) no_C = no_B;
@@ -939,7 +939,7 @@ static void rv40_pred_mv(RV40DecContext 
 /**
  * Predict motion vector for B-frame macroblock.
  */
-static inline void rv40_pred_b_vector(int A[2], int B[2], int C[2], int no_A, int no_B, int no_C, int *mx, int *my)
+static inline void rv34_pred_b_vector(int A[2], int B[2], int C[2], int no_A, int no_B, int no_C, int *mx, int *my)
 {
     if(no_A + no_B + no_C){
         *mx = A[0] + B[0] + C[0];
@@ -957,7 +957,7 @@ static inline void rv40_pred_b_vector(in
 /**
  * Motion vector prediction for B-frames.
  */
-static void rv40_pred_mv_b(RV40DecContext *r, int block_type)
+static void rv34_pred_mv_b(RV34DecContext *r, int block_type)
 {
     MpegEncContext *s = &r->s;
     int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
@@ -977,9 +977,9 @@ static void rv40_pred_mv_b(RV40DecContex
         no_A[0] = no_A[1] = 1;
     else{
         no_A[0] = no_A[1] = 0;
-        if(r->mb_type[mb_pos - 1] != RV40_MB_B_FORWARD  && r->mb_type[mb_pos - 1] != RV40_MB_B_DIRECT)
+        if(r->mb_type[mb_pos - 1] != RV34_MB_B_FORWARD  && r->mb_type[mb_pos - 1] != RV34_MB_B_DIRECT)
             no_A[0] = 1;
-        if(r->mb_type[mb_pos - 1] != RV40_MB_B_BACKWARD && r->mb_type[mb_pos - 1] != RV40_MB_B_DIRECT)
+        if(r->mb_type[mb_pos - 1] != RV34_MB_B_BACKWARD && r->mb_type[mb_pos - 1] != RV34_MB_B_DIRECT)
             no_A[1] = 1;
         if(!no_A[0]){
             A[0][0] = s->current_picture_ptr->motion_val[0][mv_pos - 1][0];
@@ -994,9 +994,9 @@ static void rv40_pred_mv_b(RV40DecContex
         no_B[0] = no_B[1] = 1;
     }else{
         no_B[0] = no_B[1] = 0;
-        if(r->mb_type[mb_pos - s->mb_stride] != RV40_MB_B_FORWARD  && r->mb_type[mb_pos - s->mb_stride] != RV40_MB_B_DIRECT)
+        if(r->mb_type[mb_pos - s->mb_stride] != RV34_MB_B_FORWARD  && r->mb_type[mb_pos - s->mb_stride] != RV34_MB_B_DIRECT)
             no_B[0] = 1;
-        if(r->mb_type[mb_pos - s->mb_stride] != RV40_MB_B_BACKWARD && r->mb_type[mb_pos - s->mb_stride] != RV40_MB_B_DIRECT)
+        if(r->mb_type[mb_pos - s->mb_stride] != RV34_MB_B_BACKWARD && r->mb_type[mb_pos - s->mb_stride] != RV34_MB_B_DIRECT)
             no_B[1] = 1;
         if(!no_B[0]){
             B[0][0] = s->current_picture_ptr->motion_val[0][mv_pos - s->b8_stride][0];
@@ -1009,16 +1009,16 @@ static void rv40_pred_mv_b(RV40DecContex
     }
     if(r->avail[2]){
         no_C[0] = no_C[1] = 0;
-        if(r->mb_type[mb_pos - s->mb_stride + 1] != RV40_MB_B_FORWARD  && r->mb_type[mb_pos - s->mb_stride + 1] != RV40_MB_B_DIRECT)
+        if(r->mb_type[mb_pos - s->mb_stride + 1] != RV34_MB_B_FORWARD  && r->mb_type[mb_pos - s->mb_stride + 1] != RV34_MB_B_DIRECT)
             no_C[0] = 1;
-        if(r->mb_type[mb_pos - s->mb_stride + 1] != RV40_MB_B_BACKWARD && r->mb_type[mb_pos - s->mb_stride + 1] != RV40_MB_B_DIRECT)
+        if(r->mb_type[mb_pos - s->mb_stride + 1] != RV34_MB_B_BACKWARD && r->mb_type[mb_pos - s->mb_stride + 1] != RV34_MB_B_DIRECT)
             no_C[1] = 1;
         c_mv_pos = mv_pos - s->b8_stride + 2;
     }else if(r->avail[3]){
         no_C[0] = no_C[1] = 0;
-        if(r->mb_type[mb_pos - s->mb_stride - 1] != RV40_MB_B_FORWARD  && r->mb_type[mb_pos - s->mb_stride - 1] != RV40_MB_B_DIRECT)
+        if(r->mb_type[mb_pos - s->mb_stride - 1] != RV34_MB_B_FORWARD  && r->mb_type[mb_pos - s->mb_stride - 1] != RV34_MB_B_DIRECT)
             no_C[0] = 1;
-        if(r->mb_type[mb_pos - s->mb_stride - 1] != RV40_MB_B_BACKWARD && r->mb_type[mb_pos - s->mb_stride - 1] != RV40_MB_B_DIRECT)
+        if(r->mb_type[mb_pos - s->mb_stride - 1] != RV34_MB_B_BACKWARD && r->mb_type[mb_pos - s->mb_stride - 1] != RV34_MB_B_DIRECT)
             no_C[1] = 1;
         c_mv_pos = mv_pos - s->b8_stride - 1;
     }else{
@@ -1034,21 +1034,21 @@ static void rv40_pred_mv_b(RV40DecContex
         C[1][1] = s->current_picture_ptr->motion_val[1][c_mv_pos][1];
     }
     switch(block_type){
-    case RV40_MB_B_FORWARD:
-        rv40_pred_b_vector(A[0], B[0], C[0], no_A[0], no_B[0], no_C[0], &mx[0], &my[0]);
+    case RV34_MB_B_FORWARD:
+        rv34_pred_b_vector(A[0], B[0], C[0], no_A[0], no_B[0], no_C[0], &mx[0], &my[0]);
         r->dmv[1][0] = 0;
         r->dmv[1][1] = 0;
         break;
-    case RV40_MB_B_BACKWARD:
+    case RV34_MB_B_BACKWARD:
         r->dmv[1][0] = r->dmv[0][0];
         r->dmv[1][1] = r->dmv[0][1];
         r->dmv[0][0] = 0;
         r->dmv[0][1] = 0;
-        rv40_pred_b_vector(A[1], B[1], C[1], no_A[1], no_B[1], no_C[1], &mx[1], &my[1]);
+        rv34_pred_b_vector(A[1], B[1], C[1], no_A[1], no_B[1], no_C[1], &mx[1], &my[1]);
         break;
-    case RV40_MB_B_DIRECT:
-        rv40_pred_b_vector(A[0], B[0], C[0], no_A[0], no_B[0], no_C[0], &mx[0], &my[0]);
-        rv40_pred_b_vector(A[1], B[1], C[1], no_A[1], no_B[1], no_C[1], &mx[1], &my[1]);
+    case RV34_MB_B_DIRECT:
+        rv34_pred_b_vector(A[0], B[0], C[0], no_A[0], no_B[0], no_C[0], &mx[0], &my[0]);
+        rv34_pred_b_vector(A[1], B[1], C[1], no_A[1], no_B[1], no_C[1], &mx[1], &my[1]);
         break;
     default:
         no_A[0] = no_A[1] = no_B[0] = no_B[1] = no_C[0] = no_C[1] = 1;
@@ -1079,7 +1079,7 @@ static void rv40_pred_mv_b(RV40DecContex
  * @param width width of the current partition in 8x8 blocks
  * @param height height of the current partition in 8x8 blocks
  */
-static inline void rv40_mc(RV40DecContext *r, const int block_type,
+static inline void rv34_mc(RV34DecContext *r, const int block_type,
                           const int xoff, const int yoff, int mv_off,
                           const int width, const int height)
 {
@@ -1121,21 +1121,21 @@ static inline void rv40_mc(RV40DecContex
     Y = s->dest[0] + xoff + yoff*s->linesize;
     U = s->dest[1] + (xoff>>1) + (yoff>>1)*s->uvlinesize;
     V = s->dest[2] + (xoff>>1) + (yoff>>1)*s->uvlinesize;
-    if(block_type == RV40_MB_P_16x8){
+    if(block_type == RV34_MB_P_16x8){
         s->dsp.put_h264_qpel_pixels_tab[1][dxy](Y, srcY, s->linesize);
         Y    += 8;
         srcY += 8;
         s->dsp.put_h264_qpel_pixels_tab[1][dxy](Y, srcY, s->linesize);
         s->dsp.put_h264_chroma_pixels_tab[0]   (U, srcU, s->uvlinesize, 4, uvmx, uvmy);
         s->dsp.put_h264_chroma_pixels_tab[0]   (V, srcV, s->uvlinesize, 4, uvmx, uvmy);
-    }else if(block_type == RV40_MB_P_8x16){
+    }else if(block_type == RV34_MB_P_8x16){
         s->dsp.put_h264_qpel_pixels_tab[1][dxy](Y, srcY, s->linesize);
         Y    += 8 * s->linesize;
         srcY += 8 * s->linesize;
         s->dsp.put_h264_qpel_pixels_tab[1][dxy](Y, srcY, s->linesize);
         s->dsp.put_h264_chroma_pixels_tab[1]   (U, srcU, s->uvlinesize, 8, uvmx, uvmy);
         s->dsp.put_h264_chroma_pixels_tab[1]   (V, srcV, s->uvlinesize, 8, uvmx, uvmy);
-    }else if(block_type == RV40_MB_P_8x8){
+    }else if(block_type == RV34_MB_P_8x8){
         s->dsp.put_h264_qpel_pixels_tab[1][dxy](Y, srcY, s->linesize);
         s->dsp.put_h264_chroma_pixels_tab[1]   (U, srcU, s->uvlinesize, 4, uvmx, uvmy);
         s->dsp.put_h264_chroma_pixels_tab[1]   (V, srcV, s->uvlinesize, 4, uvmx, uvmy);
@@ -1152,14 +1152,14 @@ static inline void rv40_mc(RV40DecContex
  * @param r decoder context
  * @param block_type type of the current block
  */
-static inline void rv40_mc_b(RV40DecContext *r, const int block_type)
+static inline void rv34_mc_b(RV34DecContext *r, const int block_type)
 {
     MpegEncContext *s = &r->s;
     uint8_t *srcY, *srcU, *srcV;
     int dxy, mx, my, uvmx, uvmy, src_x, src_y, uvsrc_x, uvsrc_y;
     int mv_pos = s->mb_x * 2 + s->mb_y * 2 * s->b8_stride;
 
-    if(block_type != RV40_MB_B_BACKWARD){
+    if(block_type != RV34_MB_B_BACKWARD){
         mx = s->current_picture_ptr->motion_val[0][mv_pos][0];
         my = s->current_picture_ptr->motion_val[0][mv_pos][1];
         srcY = s->last_picture_ptr->data[0];
@@ -1172,7 +1172,7 @@ static inline void rv40_mc_b(RV40DecCont
         srcU = s->next_picture_ptr->data[1];
         srcV = s->next_picture_ptr->data[2];
     }
-    if(block_type == RV40_MB_B_INTERP){
+    if(block_type == RV34_MB_B_INTERP){
         mx += (s->next_picture_ptr->motion_val[0][mv_pos][0] + 1) >> 1;
         my += (s->next_picture_ptr->motion_val[0][mv_pos][1] + 1) >> 1;
     }
@@ -1212,7 +1212,7 @@ static inline void rv40_mc_b(RV40DecCont
  * @param r decoder context
  * @param block_type type of the current block
  */
-static inline void rv40_mc_b_interp(RV40DecContext *r, const int block_type)
+static inline void rv34_mc_b_interp(RV34DecContext *r, const int block_type)
 {
     MpegEncContext *s = &r->s;
     uint8_t *srcY, *srcU, *srcV;
@@ -1221,7 +1221,7 @@ static inline void rv40_mc_b_interp(RV40
 
     mx = s->current_picture_ptr->motion_val[1][mv_pos][0];
     my = s->current_picture_ptr->motion_val[1][mv_pos][1];
-    if(block_type == RV40_MB_B_INTERP){
+    if(block_type == RV34_MB_B_INTERP){
         mx -= s->next_picture_ptr->motion_val[0][mv_pos][0] >> 1;
         my -= s->next_picture_ptr->motion_val[0][mv_pos][1] >> 1;
     }
@@ -1263,15 +1263,15 @@ static inline void rv40_mc_b_interp(RV40
  * Decode motion vector differences
  * and perform motion vector reconstruction and motion compensation.
  */
-static int rv40_decode_mv(RV40DecContext *r, int block_type)
+static int rv34_decode_mv(RV34DecContext *r, int block_type)
 {
     MpegEncContext *s = &r->s;
     GetBitContext *gb = &s->gb;
     int i, j;
 
     switch(block_type){
-    case RV40_MB_TYPE_INTRA:
-    case RV40_MB_TYPE_INTRA16x16:
+    case RV34_MB_TYPE_INTRA:
+    case RV34_MB_TYPE_INTRA16x16:
         for(j = 0; j < 2; j++){
             for(i = 0; i < 2; i++){
                 s->current_picture_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride + i + j*s->b8_stride][0] = 0;
@@ -1279,66 +1279,66 @@ static int rv40_decode_mv(RV40DecContext
             }
         }
         return 0;
-    case RV40_MB_SKIP:
+    case RV34_MB_SKIP:
         r->dmv[0][0] = 0;
         r->dmv[0][1] = 0;
         if(s->pict_type == P_TYPE){
-            rv40_pred_mv(r, block_type, 0);
-            rv40_mc(r, block_type, 0, 0, 0, 2, 2);
+            rv34_pred_mv(r, block_type, 0);
+            rv34_mc(r, block_type, 0, 0, 0, 2, 2);
             break;
         }
-    case RV40_MB_B_INTERP:
+    case RV34_MB_B_INTERP:
         r->dmv[0][0] = 0;
         r->dmv[0][1] = 0;
         r->dmv[1][0] = 0;
         r->dmv[1][1] = 0;
-        rv40_pred_mv_b  (r, RV40_MB_B_INTERP);
-        rv40_mc_b       (r, RV40_MB_B_INTERP);
-        rv40_mc_b_interp(r, RV40_MB_B_INTERP);
+        rv34_pred_mv_b  (r, RV34_MB_B_INTERP);
+        rv34_mc_b       (r, RV34_MB_B_INTERP);
+        rv34_mc_b_interp(r, RV34_MB_B_INTERP);
         break;
-    case RV40_MB_P_16x16:
-    case RV40_MB_P_MIX16x16:
+    case RV34_MB_P_16x16:
+    case RV34_MB_P_MIX16x16:
         r->dmv[0][0] = get_omega_signed(gb);
         r->dmv[0][1] = get_omega_signed(gb);
-        rv40_pred_mv(r, block_type, 0);
-        rv40_mc(r, block_type, 0, 0, 0, 2, 2);
+        rv34_pred_mv(r, block_type, 0);
+        rv34_mc(r, block_type, 0, 0, 0, 2, 2);
         break;
-    case RV40_MB_B_FORWARD:
-    case RV40_MB_B_BACKWARD:
+    case RV34_MB_B_FORWARD:
+    case RV34_MB_B_BACKWARD:
         r->dmv[0][0] = get_omega_signed(gb);
         r->dmv[0][1] = get_omega_signed(gb);
-        rv40_pred_mv_b  (r, block_type);
-        rv40_mc_b       (r, block_type);
+        rv34_pred_mv_b  (r, block_type);
+        rv34_mc_b       (r, block_type);
         break;
-    case RV40_MB_P_16x8:
-    case RV40_MB_P_8x16:
-    case RV40_MB_B_DIRECT:
+    case RV34_MB_P_16x8:
+    case RV34_MB_P_8x16:
+    case RV34_MB_B_DIRECT:
         r->dmv[0][0] = get_omega_signed(gb);
         r->dmv[0][1] = get_omega_signed(gb);
         r->dmv[1][0] = get_omega_signed(gb);
         r->dmv[1][1] = get_omega_signed(gb);
-        rv40_pred_mv(r, block_type, 0);
-        rv40_pred_mv(r, block_type, 1);
-        if(block_type == RV40_MB_P_16x8){
-            rv40_mc(r, block_type, 0, 0, 0,            2, 1);
-            rv40_mc(r, block_type, 0, 8, s->b8_stride, 2, 1);
+        rv34_pred_mv(r, block_type, 0);
+        rv34_pred_mv(r, block_type, 1);
+        if(block_type == RV34_MB_P_16x8){
+            rv34_mc(r, block_type, 0, 0, 0,            2, 1);
+            rv34_mc(r, block_type, 0, 8, s->b8_stride, 2, 1);
         }
-        if(block_type == RV40_MB_P_8x16){
-            rv40_mc(r, block_type, 0, 0, 0, 1, 2);
-            rv40_mc(r, block_type, 8, 0, 1, 1, 2);
+        if(block_type == RV34_MB_P_8x16){
+            rv34_mc(r, block_type, 0, 0, 0, 1, 2);
+            rv34_mc(r, block_type, 8, 0, 1, 1, 2);
         }
-        if(block_type == RV40_MB_B_DIRECT){
-            rv40_pred_mv_b  (r, block_type);
-            rv40_mc_b       (r, block_type);
-            rv40_mc_b_interp(r, block_type);
+        if(block_type == RV34_MB_B_DIRECT){
+            rv34_pred_mv_b  (r, block_type);
+            rv34_mc_b       (r, block_type);
+            rv34_mc_b_interp(r, block_type);
         }
         break;
-    case RV40_MB_P_8x8:
+    case RV34_MB_P_8x8:
         for(i=0;i< 4;i++){
             r->dmv[i][0] = get_omega_signed(gb);
             r->dmv[i][1] = get_omega_signed(gb);
-            rv40_pred_mv(r, block_type, i);
-            rv40_mc(r, block_type, (i&1)<<3, (i&2)<<2, (i&1)+(i>>1)*s->b8_stride, 1, 1);
+            rv34_pred_mv(r, block_type, i);
+            rv34_mc(r, block_type, (i&1)<<3, (i&2)<<2, (i&1)+(i>>1)*s->b8_stride, 1, 1);
         }
         break;
     }
@@ -1365,7 +1365,7 @@ static const int ittrans16[4] = {
 /**
  * Perform 4x4 intra prediction
  */
-static void rv40_pred_4x4_block(RV40DecContext *r, uint8_t *dst, int stride, int itype, int no_up, int no_left, int no_down, int no_right)
+static void rv34_pred_4x4_block(RV34DecContext *r, uint8_t *dst, int stride, int itype, int no_up, int no_left, int no_down, int no_right)
 {
     uint8_t *prev = dst - stride + 4;
     uint32_t topleft;
@@ -1392,7 +1392,7 @@ static void rv40_pred_4x4_block(RV40DecC
 }
 
 /** add_pixels_clamped for 4x4 block */
-static void rv40_add_4x4_block(uint8_t *dst, int stride, DCTELEM block[64], int off)
+static void rv34_add_4x4_block(uint8_t *dst, int stride, DCTELEM block[64], int off)
 {
     int x, y;
     for(y = 0; y < 4; y++)
@@ -1400,7 +1400,7 @@ static void rv40_add_4x4_block(uint8_t *
             dst[x + y*stride] = av_clip_uint8(dst[x + y*stride] + block[off + x+y*8]);
 }
 
-static void rv40_output_macroblock(RV40DecContext *r, int *intra_types, int cbp, int is16)
+static void rv34_output_macroblock(RV34DecContext *r, int *intra_types, int cbp, int is16)
 {
     MpegEncContext *s = &r->s;
     DSPContext *dsp = &s->dsp;
@@ -1418,10 +1418,10 @@ static void rv40_output_macroblock(RV40D
             YY = Y;
             for(i = 0; i < 4; i++, cbp >>= 1, YY += 4){
                 no_topright = no_up || (i==3 && j) || (i==3 && !j && (s->mb_x-1) == s->mb_width);
-                rv40_pred_4x4_block(r, YY, s->linesize, ittrans[intra_types[i]], no_up, no_left, i || (j==3), no_topright);
+                rv34_pred_4x4_block(r, YY, s->linesize, ittrans[intra_types[i]], no_up, no_left, i || (j==3), no_topright);
                 no_left = 0;
                 if(!(cbp & 1)) continue;
-                rv40_add_4x4_block(YY, s->linesize, s->block[(i>>1)+(j&2)], (i&1)*4+(j&1)*32);
+                rv34_add_4x4_block(YY, s->linesize, s->block[(i>>1)+(j&2)], (i&1)*4+(j&1)*32);
             }
             no_up = 0;
             Y += s->linesize * 4;
@@ -1433,12 +1433,12 @@ static void rv40_output_macroblock(RV40D
             no_left = !r->avail[0];
             for(i = 0; i < 2; i++, cbp >>= 1, no_left = 0){
                 no_topright = no_up || (i && j) || (i && !j && (s->mb_x-1) == s->mb_width);
-                rv40_pred_4x4_block(r, U + i*4 + j*4*s->uvlinesize, s->uvlinesize, ittrans[intra_types[i*2+j*2*r->intra_types_stride]], no_up, no_left, i || j, no_topright);
-                rv40_pred_4x4_block(r, V + i*4 + j*4*s->uvlinesize, s->uvlinesize, ittrans[intra_types[i*2+j*2*r->intra_types_stride]], no_up, no_left, i || j, no_topright);
+                rv34_pred_4x4_block(r, U + i*4 + j*4*s->uvlinesize, s->uvlinesize, ittrans[intra_types[i*2+j*2*r->intra_types_stride]], no_up, no_left, i || j, no_topright);
+                rv34_pred_4x4_block(r, V + i*4 + j*4*s->uvlinesize, s->uvlinesize, ittrans[intra_types[i*2+j*2*r->intra_types_stride]], no_up, no_left, i || j, no_topright);
                 if(cbp & 0x01)
-                    rv40_add_4x4_block(U + i*4 + j*4*s->uvlinesize, s->uvlinesize, s->block[4], i*4+j*32);
+                    rv34_add_4x4_block(U + i*4 + j*4*s->uvlinesize, s->uvlinesize, s->block[4], i*4+j*32);
                 if(cbp & 0x10)
-                    rv40_add_4x4_block(V + i*4 + j*4*s->uvlinesize, s->uvlinesize, s->block[5], i*4+j*32);
+                    rv34_add_4x4_block(V + i*4 + j*4*s->uvlinesize, s->uvlinesize, s->block[5], i*4+j*32);
             }
             no_up = 0;
         }
@@ -1487,7 +1487,7 @@ static void rv40_output_macroblock(RV40D
  * @addtogroup bitstream
  * Decode macroblock header and return CBP in case of success, -1 otherwise.
  */
-static int rv40_decode_mb_header(RV40DecContext *r, int *intra_types)
+static int rv34_decode_mb_header(RV34DecContext *r, int *intra_types)
 {
     MpegEncContext *s = &r->s;
     GetBitContext *gb = &s->gb;
@@ -1508,26 +1508,26 @@ static int rv40_decode_mb_header(RV40Dec
             break;
         }
         s->current_picture_ptr->mb_type[mb_pos] = r->is16 ? MB_TYPE_INTRA16x16 : MB_TYPE_INTRA;
-        r->block_type = r->is16 ? RV40_MB_TYPE_INTRA16x16 : RV40_MB_TYPE_INTRA;
+        r->block_type = r->is16 ? RV34_MB_TYPE_INTRA16x16 : RV34_MB_TYPE_INTRA;
     }else if(!r->si.type && r->rv30){
         r->is16 = get_bits1(gb);
         s->current_picture_ptr->mb_type[mb_pos] = r->is16 ? MB_TYPE_INTRA16x16 : MB_TYPE_INTRA;
-        r->block_type = r->is16 ? RV40_MB_TYPE_INTRA16x16 : RV40_MB_TYPE_INTRA;
+        r->block_type = r->is16 ? RV34_MB_TYPE_INTRA16x16 : RV34_MB_TYPE_INTRA;
     }else{
         r->block_type = r->rv30 ? rv30_decode_mb_info(r) : rv40_decode_mb_info(r);
         if(r->block_type == -1)
             return -1;
-        s->current_picture_ptr->mb_type[mb_pos] = rv40_mb_type_to_lavc[r->block_type];
+        s->current_picture_ptr->mb_type[mb_pos] = rv34_mb_type_to_lavc[r->block_type];
         r->mb_type[mb_pos] = r->block_type;
-        if(r->block_type == RV40_MB_SKIP){
+        if(r->block_type == RV34_MB_SKIP){
             if(s->pict_type == P_TYPE)
-                r->mb_type[mb_pos] = RV40_MB_P_16x16;
+                r->mb_type[mb_pos] = RV34_MB_P_16x16;
             if(s->pict_type == B_TYPE)
-                r->mb_type[mb_pos] = RV40_MB_B_INTERP;
+                r->mb_type[mb_pos] = RV34_MB_B_INTERP;
         }
         r->is16 = !!IS_INTRA16x16(s->current_picture_ptr->mb_type[mb_pos]);
-        rv40_decode_mv(r, r->block_type);
-        if(r->block_type == RV40_MB_SKIP){
+        rv34_decode_mv(r, r->block_type);
+        if(r->block_type == RV34_MB_SKIP){
             for(i = 0; i < 16; i++)
                 intra_types[(i & 3) + (i>>2) * r->intra_types_stride] = 0;
             return 0;
@@ -1558,14 +1558,14 @@ static int rv40_decode_mb_header(RV40Dec
         for(i = 0; i < 16; i++)
             intra_types[(i & 3) + (i>>2) * r->intra_types_stride] = 0;
         r->cur_vlcs = choose_vlc_set(r->si.quant, r->si.vlc_set, 1);
-        if(r->mb_type[mb_pos] == RV40_MB_P_MIX16x16){
+        if(r->mb_type[mb_pos] == RV34_MB_P_MIX16x16){
             r->is16 = 1;
             r->chroma_vlc = 1;
             r->luma_vlc   = 2;
             r->cur_vlcs = choose_vlc_set(r->si.quant, r->si.vlc_set, 0);
         }
     }
-    return rv40_decode_cbp(gb, r->cur_vlcs, r->is16);
+    return rv34_decode_cbp(gb, r->cur_vlcs, r->is16);
 }
 
 /**
@@ -1581,7 +1581,7 @@ static int rv40_decode_mb_header(RV40Dec
 #define V_CBP_MASK 0xF00000
 
 
-static void rv40_apply_differences(RV40DecContext *r, int cbp)
+static void rv34_apply_differences(RV34DecContext *r, int cbp)
 {
     static const int shifts[4] = { 0, 2, 8, 10 };
     MpegEncContext *s = &r->s;
@@ -1596,7 +1596,7 @@ static void rv40_apply_differences(RV40D
         s->dsp.add_pixels_clamped(s->block[5], s->dest[2], s->uvlinesize);
 }
 
-static int rv40_decode_macroblock(RV40DecContext *r, int *intra_types)
+static int rv34_decode_macroblock(RV34DecContext *r, int *intra_types)
 {
     MpegEncContext *s = &r->s;
     GetBitContext *gb = &s->gb;
@@ -1617,7 +1617,7 @@ static int rv40_decode_macroblock(RV40De
         r->avail[3] = 1;
 
     s->qscale = r->si.quant;
-    cbp = cbp2 = rv40_decode_mb_header(r, intra_types);
+    cbp = cbp2 = rv34_decode_mb_header(r, intra_types);
 
     if(cbp == -1)
         return -1;
@@ -1625,9 +1625,9 @@ static int rv40_decode_macroblock(RV40De
     luma_dc_quant = r->rv30 ? rv30_luma_dc_quant[s->qscale] : rv40_luma_quant[r->si.type>>1][s->qscale];
     if(r->is16){
         memset(block16, 0, sizeof(block16));
-        rv40_decode_block(block16, gb, r->cur_vlcs, 3, 0);
-        rv40_dequant4x4_16x16(block16, 0, rv40_qscale_tab[luma_dc_quant],rv40_qscale_tab[s->qscale]);
-        rv40_intra_inv_transform_noround(block16, 0);
+        rv34_decode_block(block16, gb, r->cur_vlcs, 3, 0);
+        rv34_dequant4x4_16x16(block16, 0, rv34_qscale_tab[luma_dc_quant],rv34_qscale_tab[s->qscale]);
+        rv34_intra_inv_transform_noround(block16, 0);
     }
 
     for(i = 0; i < 16; i++, cbp >>= 1){
@@ -1635,33 +1635,33 @@ static int rv40_decode_macroblock(RV40De
         blknum = ((i & 2) >> 1) + ((i & 8) >> 2);
         blkoff = ((i & 1) << 2) + ((i & 4) << 3);
         if(cbp & 1)
-            rv40_decode_block(s->block[blknum] + blkoff, gb, r->cur_vlcs, r->luma_vlc, 0);
+            rv34_decode_block(s->block[blknum] + blkoff, gb, r->cur_vlcs, r->luma_vlc, 0);
         if((cbp & 1) || r->is16){
-            rv40_dequant4x4(s->block[blknum], blkoff, rv40_qscale_tab[luma_dc_quant],rv40_qscale_tab[s->qscale]);
+            rv34_dequant4x4(s->block[blknum], blkoff, rv34_qscale_tab[luma_dc_quant],rv34_qscale_tab[s->qscale]);
             if(r->is16) //FIXME: optimize
                 s->block[blknum][blkoff] = block16[(i & 3) | ((i & 0xC) << 1)];
-            rv40_intra_inv_transform(s->block[blknum], blkoff);
+            rv34_intra_inv_transform(s->block[blknum], blkoff);
         }
     }
-    if(r->block_type == RV40_MB_P_MIX16x16)
+    if(r->block_type == RV34_MB_P_MIX16x16)
         r->cur_vlcs = choose_vlc_set(r->si.quant, r->si.vlc_set, 1);
     for(; i < 24; i++, cbp >>= 1){
         if(!(cbp & 1)) continue;
         blknum = ((i & 4) >> 2) + 4;
         blkoff = ((i & 1) << 2) + ((i & 2) << 4);
-        rv40_decode_block(s->block[blknum] + blkoff, gb, r->cur_vlcs, r->chroma_vlc, 1);
-        rv40_dequant4x4(s->block[blknum], blkoff, rv40_qscale_tab[rv40_chroma_quant[1][s->qscale]],rv40_qscale_tab[rv40_chroma_quant[0][s->qscale]]);
-        rv40_intra_inv_transform(s->block[blknum], blkoff);
+        rv34_decode_block(s->block[blknum] + blkoff, gb, r->cur_vlcs, r->chroma_vlc, 1);
+        rv34_dequant4x4(s->block[blknum], blkoff, rv34_qscale_tab[rv34_chroma_quant[1][s->qscale]],rv34_qscale_tab[rv34_chroma_quant[0][s->qscale]]);
+        rv34_intra_inv_transform(s->block[blknum], blkoff);
     }
     if(IS_INTRA(s->current_picture_ptr->mb_type[s->mb_x + s->mb_y*s->mb_stride]))
-        rv40_output_macroblock(r, intra_types, cbp2, r->is16);
+        rv34_output_macroblock(r, intra_types, cbp2, r->is16);
     else
-        rv40_apply_differences(r, cbp2);
+        rv34_apply_differences(r, cbp2);
 
     return 0;
 }
 
-static int check_slice_end(RV40DecContext *r, MpegEncContext *s)
+static int check_slice_end(RV34DecContext *r, MpegEncContext *s)
 {
     int bits;
     if(r->s.mb_skip_run > 1)
@@ -1682,7 +1682,7 @@ static inline int slice_compare(SliceInf
            si1->height != si2->height;
 }
 
-static int rv40_decode_slice(RV40DecContext *r, int size, int end, int *last)
+static int rv34_decode_slice(RV34DecContext *r, int size, int end, int *last)
 {
     MpegEncContext *s = &r->s;
     GetBitContext *gb = &s->gb;
@@ -1764,7 +1764,7 @@ static int rv40_decode_slice(RV40DecCont
             r->ssi.mb_y = s->mb_y;
         }
 
-        if(rv40_decode_macroblock(r, r->intra_types + (s->mb_x + 1) * 4) < 0)
+        if(rv34_decode_macroblock(r, r->intra_types + (s->mb_x + 1) * 4) < 0)
             break;
         if (++s->mb_x == s->mb_width) {
             s->mb_x = 0;
@@ -1798,7 +1798,7 @@ static int rv40_decode_slice(RV40DecCont
 /**
  * Weaker deblocking
  */
-static inline void rv40_weak_loop_filter(uint8_t *src, const int step,
+static inline void rv34_weak_loop_filter(uint8_t *src, const int step,
                             const int flag0, const int flag1, const int mult,
                             const int lim0, const int lim1, const int lim2, const int thr1,
                             const int S0, const int S1, const int S2, const int S3)
@@ -1836,12 +1836,12 @@ static inline void rv40_weak_loop_filter
  * parameter  sub - index of the value with coefficient = 25
  * parameter last - index of the value with coefficient 25 or 51
  */
-#define RV40_STRONG_FILTER(src, step, start, last, sub) \
+#define RV34_STRONG_FILTER(src, step, start, last, sub) \
      26*(src[start*step] + src[(start+1)*step] + src[(start+2)*step] + src[(start+3)*step] + src[last*step]) - src[last*step] - src[sub*step]
 /**
  * Deblocking filter, the alternated version from JVT-A003r1 H.26L draft.
  */
-static inline void rv40_adaptive_loop_filter(uint8_t *src, const int step, const int stride, const int dmode, const int lim0, const int lim1, const int mult, const int thr0, const int thr1, const int chroma, const int edge)
+static inline void rv34_adaptive_loop_filter(uint8_t *src, const int step, const int stride, const int dmode, const int lim0, const int lim1, const int mult, const int thr0, const int thr1, const int chroma, const int edge)
 {
     int diffs[4][4];
     int s0 = 0, s1 = 0, s2 = 0, s3 = 0;
@@ -1888,8 +1888,8 @@ static inline void rv40_adaptive_loop_fi
             sflag = (mult * FFABS(t)) >> 7;
             if(sflag > 1) continue;
 
-            p0 = (RV40_STRONG_FILTER(src, step, -3, 1, -3) + rv40_dither_l[dmode + i]) >> 7;
-            p1 = (RV40_STRONG_FILTER(src, step, -1, 3, -1) + rv40_dither_r[dmode + i]) >> 7;
+            p0 = (RV34_STRONG_FILTER(src, step, -3, 1, -3) + rv34_dither_l[dmode + i]) >> 7;
+            p1 = (RV34_STRONG_FILTER(src, step, -1, 3, -1) + rv34_dither_r[dmode + i]) >> 7;
             if(!sflag){
                 src[-1*step] = p0;
                 src[ 0*step] = p1;
@@ -1903,8 +1903,8 @@ static inline void rv40_adaptive_loop_fi
                 else
                     src[ 0*step] = src[-1*step];
             }
-            p0 = (RV40_STRONG_FILTER(src, step, -4, 0, -4) + rv40_dither_l[dmode + i]) >> 7;
-            p1 = (RV40_STRONG_FILTER(src, step, -1, 3, -1) + rv40_dither_r[dmode + i]) >> 7;
+            p0 = (RV34_STRONG_FILTER(src, step, -4, 0, -4) + rv34_dither_l[dmode + i]) >> 7;
+            p1 = (RV34_STRONG_FILTER(src, step, -1, 3, -1) + rv34_dither_r[dmode + i]) >> 7;
             if(!sflag){
                 src[-2*step] = p0;
                 src[ 1*step] = p1;
@@ -1919,37 +1919,37 @@ static inline void rv40_adaptive_loop_fi
                     src[ 1*step] += v88;
             }
             if(!chroma){
-                src[-3*step] = (RV40_STRONG_FILTER(src, step, -4, -1, -3) + 64) >> 7;
-                src[ 2*step] = (RV40_STRONG_FILTER(src, step,  0,  0,  2) + 64) >> 7;
+                src[-3*step] = (RV34_STRONG_FILTER(src, step, -4, -1, -3) + 64) >> 7;
+                src[ 2*step] = (RV34_STRONG_FILTER(src, step,  0,  0,  2) + 64) >> 7;
             }
         }
     }else if(llim0 == 3 && llim1 == 3)
         for(i = 0; i < 4; i++, src += stride)
-            rv40_weak_loop_filter(src, step, 1, 1, mult, lim0, lim1, v88, thr1,
+            rv34_weak_loop_filter(src, step, 1, 1, mult, lim0, lim1, v88, thr1,
                                   diffs[i][0], diffs[i][1], diffs[i][2], diffs[i][3]);
     else
         for(i = 0; i < 4; i++, src += stride)
-            rv40_weak_loop_filter(src, step, llim0==3, llim1==3, mult, lim0>>1, lim1>>1, v88>>1, thr1,
+            rv34_weak_loop_filter(src, step, llim0==3, llim1==3, mult, lim0>>1, lim1>>1, v88>>1, thr1,
                                   diffs[i][0], diffs[i][1], diffs[i][2], diffs[i][3]);
 }
 
-static void rv40_v_loop_filter(uint8_t *src, int stride, int dmode, int lim0, int lim1, int mult, int thr0, int thr1, int chroma, int edge){
-    rv40_adaptive_loop_filter(src, 1, stride, dmode, lim0, lim1, mult, thr0, thr1, chroma, edge);
+static void rv34_v_loop_filter(uint8_t *src, int stride, int dmode, int lim0, int lim1, int mult, int thr0, int thr1, int chroma, int edge){
+    rv34_adaptive_loop_filter(src, 1, stride, dmode, lim0, lim1, mult, thr0, thr1, chroma, edge);
 }
-static void rv40_h_loop_filter(uint8_t *src, int stride, int dmode, int lim0, int lim1, int mult, int thr0, int thr1, int chroma, int edge){
-    rv40_adaptive_loop_filter(src, stride, 1, dmode, lim0, lim1, mult, thr0, thr1, chroma, edge);
+static void rv34_h_loop_filter(uint8_t *src, int stride, int dmode, int lim0, int lim1, int mult, int thr0, int thr1, int chroma, int edge){
+    rv34_adaptive_loop_filter(src, stride, 1, dmode, lim0, lim1, mult, thr0, thr1, chroma, edge);
 }
 
-static void rv40_loop_filter(RV40DecContext *r)
+static void rv34_loop_filter(RV34DecContext *r)
 {
     MpegEncContext *s = &r->s;
     int mb_pos;
     int i, j;
     int no_up, no_left;
     uint8_t *Y, *U, *V;
-    const int alpha = rv40_alpha_tab[s->qscale], beta = rv40_beta_tab[s->qscale];
+    const int alpha = rv34_alpha_tab[s->qscale], beta = rv34_beta_tab[s->qscale];
     //XXX these are probably not correct
-    const int thr = s->qscale, lim0 = rv40_filter_clip_tbl[1][s->qscale], lim1 = rv40_filter_clip_tbl[2][s->qscale];
+    const int thr = s->qscale, lim0 = rv34_filter_clip_tbl[1][s->qscale], lim1 = rv34_filter_clip_tbl[2][s->qscale];
 
     mb_pos = s->resync_mb_x + s->resync_mb_y * s->mb_stride;
     memset(r->intra_types_hist, -1, r->intra_types_stride * 4 * 2 * sizeof(int));
@@ -1966,11 +1966,11 @@ static void rv40_loop_filter(RV40DecCont
                 for(i = 0; i < 4; i++){
                     Y = s->dest[0] + i*4 + j*4*s->linesize;
                     if(!j && !no_up)
-                        rv40_h_loop_filter(Y, s->linesize, i*4+j, lim0, lim1, alpha, beta, thr, 0, 1);
+                        rv34_h_loop_filter(Y, s->linesize, i*4+j, lim0, lim1, alpha, beta, thr, 0, 1);
                     if(j != 3)
-                        rv40_h_loop_filter(Y + 4*s->linesize, s->linesize, i*4+j, lim0, lim1, alpha, beta, thr, 0, 0);
+                        rv34_h_loop_filter(Y + 4*s->linesize, s->linesize, i*4+j, lim0, lim1, alpha, beta, thr, 0, 0);
                     if(i || !no_left)
-                        rv40_v_loop_filter(Y, s->linesize, i*4+j, lim0, lim1, alpha, beta, thr, 0, !i);
+                        rv34_v_loop_filter(Y, s->linesize, i*4+j, lim0, lim1, alpha, beta, thr, 0, !i);
                 }
             }
         }
@@ -1991,9 +1991,9 @@ static void rv40_loop_filter(RV40DecCont
  * Initialize decoder
  * @todo Maybe redone in some other way
  */
-static int rv40_decode_init(AVCodecContext *avctx)
+static int rv34_decode_init(AVCodecContext *avctx)
 {
-    RV40DecContext *r = avctx->priv_data;
+    RV34DecContext *r = avctx->priv_data;
     MpegEncContext *s = &r->s;
 
     static int tables_done = 0;
@@ -2026,7 +2026,7 @@ static int rv40_decode_init(AVCodecConte
     r->mb_type = av_mallocz(r->s.mb_stride * r->s.mb_height * sizeof(int));
 
     if(!tables_done){
-        rv40_init_tables();
+        rv34_init_tables();
         tables_done = 1;
     }
     r->prev_si.type = -1;
@@ -2041,11 +2041,11 @@ static int rv40_decode_init(AVCodecConte
     return 0;
 }
 
-static int rv40_decode_frame(AVCodecContext *avctx,
+static int rv34_decode_frame(AVCodecContext *avctx,
                             void *data, int *data_size,
                             uint8_t *buf, int buf_size)
 {
-    RV40DecContext *r = avctx->priv_data;
+    RV34DecContext *r = avctx->priv_data;
     MpegEncContext *s = &r->s;
     AVFrame *pict = data;
     SliceInfo si;
@@ -2098,10 +2098,7 @@ static int rv40_decode_frame(AVCodecCont
                 r->si.end = si.start;
         }
         r->slice_data = buf + offset;
-        if(r->rv30)
-            rv40_decode_slice(r, r->si.size, r->si.end, &last);
-        else
-            rv40_decode_slice(r, r->si.size, r->si.end, &last);
+        rv34_decode_slice(r, r->si.size, r->si.end, &last);
         if(last)
             break;
         s->mb_num_left = r->si.end - r->si.start;
@@ -2127,9 +2124,9 @@ static int rv40_decode_frame(AVCodecCont
     return buf_size;
 }
 
-static int rv40_decode_end(AVCodecContext *avctx)
+static int rv34_decode_end(AVCodecContext *avctx)
 {
-    RV40DecContext *r = avctx->priv_data;
+    RV34DecContext *r = avctx->priv_data;
 
     MPV_common_end(&r->s);
 
@@ -2145,20 +2142,20 @@ AVCodec rv30_decoder = {
     "rv30",
     CODEC_TYPE_VIDEO,
     CODEC_ID_RV30,
-    sizeof(RV40DecContext),
-    rv40_decode_init,
+    sizeof(RV34DecContext),
+    rv34_decode_init,
     NULL,
-    rv40_decode_end,
-    rv40_decode_frame,
+    rv34_decode_end,
+    rv34_decode_frame,
 };
 
 AVCodec rv40_decoder = {
     "rv40",
     CODEC_TYPE_VIDEO,
     CODEC_ID_RV40,
-    sizeof(RV40DecContext),
-    rv40_decode_init,
+    sizeof(RV34DecContext),
+    rv34_decode_init,
     NULL,
-    rv40_decode_end,
-    rv40_decode_frame,
+    rv34_decode_end,
+    rv34_decode_frame,
 };

Modified: rv40/rv40data.h
==============================================================================
--- rv40/rv40data.h	(original)
+++ rv40/rv40data.h	Mon Sep 17 19:22:37 2007
@@ -32,14 +32,14 @@
 /**
  * Number of ones in nibble minus one
  */
-static const uint8_t rv40_count_ones[16] = {
+static const uint8_t rv34_count_ones[16] = {
     0, 0, 0, 1, 0, 1, 1, 2, 0, 1, 1, 2, 1, 2, 2, 3
 };
 
 /**
  * Values used to reconstruct coded block pattern
  */
-static const uint8_t rv40_cbp_code[16] = {
+static const uint8_t rv34_cbp_code[16] = {
     0x00, 0x20, 0x10, 0x30, 0x02, 0x22, 0x12, 0x32,
     0x01, 0x21, 0x11, 0x31, 0x03, 0x23, 0x13, 0x33
 };
@@ -120,7 +120,7 @@ static const uint8_t rv40_luma_quant[2][
  * Chroma quantizer values
  * Second table is used for DC-only blocks
  */
-static const uint8_t rv40_chroma_quant[2][32] = {
+static const uint8_t rv34_chroma_quant[2][32] = {
  {  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
    16, 17, 17, 18, 19, 20, 20, 21, 22, 22, 23, 23, 24, 24, 25, 25 },
  {  0,  0,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13,
@@ -130,7 +130,7 @@ static const uint8_t rv40_chroma_quant[2
 /**
  * This table is used for dequantizing
  */
-static const uint16_t rv40_qscale_tab[32] = {
+static const uint16_t rv34_qscale_tab[32] = {
   60,   67,   76,   85,   96,  108,  121,  136,
  152,  171,  192,  216,  242,  272,  305,  341,
  383,  432,  481,  544,  606,  683,  767,  854,
@@ -140,7 +140,7 @@ static const uint16_t rv40_qscale_tab[32
 /**
  * 4x4 dezigzag pattern
  */
-static const uint8_t rv40_dezigzag[16] = {
+static const uint8_t rv34_dezigzag[16] = {
   0,  1,  8, 16,
   9,  2,  3, 10,
  17, 24, 25, 18,
@@ -151,7 +151,7 @@ static const uint8_t rv40_dezigzag[16] =
  * Tables used to translate quantizer value into VLC set for decoding
  * First table is used for intraframes.
  */
-static const uint8_t rv40_quant_to_vlc_set[2][31] = {
+static const uint8_t rv34_quant_to_vlc_set[2][31] = {
  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
    2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 0 },
  { 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3,
@@ -161,7 +161,7 @@ static const uint8_t rv40_quant_to_vlc_s
 /**
  * Table for obtaining quantizer difference
  */
-static const int8_t rv40_dquant_tab[] = {
+static const int8_t rv34_dquant_tab[] = {
   0,  0,  2,  1, -1,  1, -1,  1, -1,  1, -1,  1, -1,  1, -1,  1,
  -1,  1, -1,  1, -1,  1, -2,  2, -2,  2, -2,  2, -2,  2, -2,  2,
  -2,  2, -2,  2, -2,  2, -2,  2, -2,  2, -3,  3, -3,  3, -3,  3,
@@ -172,24 +172,24 @@ static const int8_t rv40_dquant_tab[] = 
  * Maximum number of macroblocks for each of the possible slice offset sizes
  * @todo this is the same as ff_mba_max, maybe use it instead
  */
-static const uint16_t rv40_mb_max_sizes[6] = { 0x2F, 0x68, 0x18B, 0x62F, 0x18BF, 0x23FF };
+static const uint16_t rv34_mb_max_sizes[6] = { 0x2F, 0x68, 0x18B, 0x62F, 0x18BF, 0x23FF };
 /**
  * Bits needed to code slice offset for the given size
  * @todo this is the same as ff_mba_length, maybe use it instead
  */
-static const uint8_t rv40_mb_bits_sizes[6] = { 6, 7, 9, 11, 13, 14 };
+static const uint8_t rv34_mb_bits_sizes[6] = { 6, 7, 9, 11, 13, 14 };
 
 /**
  * Dither values for deblocking filter - left/top values
  */
-static const uint8_t rv40_dither_l[16] = {
+static const uint8_t rv34_dither_l[16] = {
     0x40, 0x50, 0x20, 0x60, 0x30, 0x50, 0x40, 0x30,
     0x50, 0x40, 0x50, 0x30, 0x60, 0x20, 0x50, 0x40
 };
 /**
  * Dither values for deblocking filter - right/bottom values
  */
-static const uint8_t rv40_dither_r[16] = {
+static const uint8_t rv34_dither_r[16] = {
     0x40, 0x30, 0x60, 0x20, 0x50, 0x30, 0x30, 0x40,
     0x40, 0x40, 0x50, 0x30, 0x20, 0x60, 0x30, 0x40
 };
@@ -199,19 +199,19 @@ static const uint8_t rv40_dither_r[16] =
  * @{
  */
 /** alpha parameter for RV40 loop filter - almost the same as in JVT-A003r1 */
-static const uint8_t rv40_alpha_tab[32] = {
+static const uint8_t rv34_alpha_tab[32] = {
     128, 128, 128, 128, 128, 128, 128, 128,
     128, 128, 122,  96,  75,  59,  47,  37,
      29,  23,  18,  15,  13,  11,  10,   9,
       8,   7,   6,   5,   4,   3,   2,   1
 };
 /** beta parameter for RV40 loop filter - almost the same as in JVT-A003r1 */
-static const uint8_t rv40_beta_tab[32] = {
+static const uint8_t rv34_beta_tab[32] = {
      0,  0,  0,  0,  0,  0,  0,  0,  3,  3,  3,  4,  4,  4,  6,  6,
      6,  7,  8,  8,  9,  9, 10, 10, 11, 11, 12, 13, 14, 15, 16, 17
 };
 /** clip table for RV40 loop filter - the same as in JVT-A003r1 */
-static const uint8_t rv40_filter_clip_tbl[3][32] = {
+static const uint8_t rv34_filter_clip_tbl[3][32] = {
     {
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

Modified: rv40/rv40vlc.h
==============================================================================
--- rv40/rv40vlc.h	(original)
+++ rv40/rv40vlc.h	Mon Sep 17 19:22:37 2007
@@ -40,7 +40,7 @@
 
 // INTRA TABLES
 // BLOCK 0
-static const uint8_t rv40_table_0_0_0[CBPPAT_VLC_SIZE] =
+static const uint8_t rv34_table_0_0_0[CBPPAT_VLC_SIZE] =
  {
   8, 10, 10, 10, 10, 10, 11, 10, 10, 11, 10, 10, 10, 10, 10,  6,
  12, 12, 13, 12, 13, 12, 13, 11, 13, 13, 13, 12, 13, 12, 12,  8,
@@ -125,14 +125,14 @@ static const uint8_t rv40_table_0_0_0[CB
  16, 16, 16, 13, 16, 13, 16, 10, 16, 16, 13, 10, 13, 10, 10,  1,
 };
 
-static const uint8_t rv40_table_0_0_1[4][CBP_VLC_SIZE] = {
+static const uint8_t rv34_table_0_0_1[4][CBP_VLC_SIZE] = {
  { 0,  3,  3,  4,  3,  5,  5,  5,  2,  5,  4,  6,  4,  6,  6,  6 },
  { 0,  3,  4,  4,  3,  4,  5,  5,  3,  5,  4,  5,  4,  5,  5,  3 },
  { 0,  4,  4,  4,  4,  5,  5,  4,  4,  5,  4,  5,  4,  4,  4,  2 },
  { 0,  6,  6,  5,  6,  5,  6,  4,  6,  6,  5,  4,  4,  4,  4,  1 }
 };
 
-static const uint8_t rv40_table_0_0_2[CBPPAT_VLC_SIZE] =  {
+static const uint8_t rv34_table_0_0_2[CBPPAT_VLC_SIZE] =  {
   2,  7,  7,  8,  7,  8,  9,  8,  7,  9,  8,  8,  8,  8,  9,  7,
   6,  9, 10, 10, 10, 10, 11, 10, 10, 11, 11, 11, 10, 11, 11,  9,
   9, 11, 12, 12, 12, 13, 14, 13, 13, 14, 14, 13, 13, 13, 14, 11,
@@ -216,14 +216,14 @@ static const uint8_t rv40_table_0_0_2[CB
   8, 10, 10, 10, 10, 10, 11,  9, 10, 11, 10,  9, 10,  9,  9,  5,
 };
 
-static const uint8_t rv40_table_0_0_3[4][CBP_VLC_SIZE] = {
+static const uint8_t rv34_table_0_0_3[4][CBP_VLC_SIZE] = {
  { 0,  2,  3,  4,  2,  5,  6,  7,  3,  6,  5,  7,  4,  7,  8,  8 },
  { 0,  3,  3,  4,  3,  4,  5,  5,  3,  5,  4,  6,  3,  5,  6,  5 },
  { 0,  3,  3,  4,  3,  4,  5,  5,  3,  5,  4,  5,  4,  5,  5,  4 },
  { 0,  4,  4,  4,  4,  5,  5,  4,  4,  5,  5,  4,  4,  4,  4,  2 }
 };
 
-static const uint8_t rv40_table_0_0_4[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_0_4[FIRSTBLK_VLC_SIZE] = {
   0,  9,  6,  9,  6, 10,  8,  9,  7, 11,  8, 11,  9, 11,  9, 10,
  14, 16, 13, 14, 13, 14, 12, 11,  5, 11,  7, 10,  8, 10,  8,  9,
   8, 12,  8, 11,  9, 12,  9, 10, 14, 16, 12, 13, 13, 14, 11, 11,
@@ -280,7 +280,7 @@ static const uint8_t rv40_table_0_0_4[FI
  11, 14,  9, 10, 10, 11,  8,  6, 12, 15,  9,  9,  9, 10,  7,  4,
 };
 
-static const uint8_t rv40_table_0_0_5[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_0_5[FIRSTBLK_VLC_SIZE] = {
   0,  6,  3,  7,  3,  7,  6,  7,  5,  9,  6,  9,  7,  9,  8,  8,
  16, 16, 16, 16, 16, 16, 16, 11,  3,  8,  5,  8,  6,  8,  7,  7,
   7, 11,  7, 10,  8, 10,  8,  9, 16, 16, 16, 16, 16, 16, 14, 10,
@@ -337,7 +337,7 @@ static const uint8_t rv40_table_0_0_5[FI
  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 };
 
-static const uint8_t rv40_table_0_0_6[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_0_6[FIRSTBLK_VLC_SIZE] = {
   2,  8,  5,  9,  6,  9,  8,  8,  8, 12,  9, 11,  9, 11, 10, 10,
  16, 16, 14, 16, 14, 16, 14, 12,  5, 10,  6,  9,  8, 10,  8,  9,
   9, 12,  9, 11, 10, 12, 10, 10, 16, 16, 14, 15, 15, 16, 13, 12,
@@ -394,7 +394,7 @@ static const uint8_t rv40_table_0_0_6[FI
  13, 16, 12, 13, 12, 13, 11, 10, 16, 16, 13, 14, 13, 14, 11,  8,
 };
 
-static const uint8_t rv40_table_0_0_7[OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_0_7[OTHERBLK_VLC_SIZE] = {
   0,  5, 10,  3,  6, 10,  7,  8,  9,  4,  6, 10,  6,  7,  9,  8,
   8,  9,  8,  8,  9,  8,  9,  9,  9,  9,  8,  3,  6, 10,  4,  6,
  10,  7,  7,  9,  5,  7, 10,  6,  7,  9,  7,  7,  8,  7,  8,  9,
@@ -404,7 +404,7 @@ static const uint8_t rv40_table_0_0_7[OT
   7,  7,  7,  8,  8,  8,  7,  7,  7,  7,  6,  5
 };
 
-static const uint8_t rv40_table_0_0_8[OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_0_8[OTHERBLK_VLC_SIZE] = {
   0,  5, 10,  3,  6, 10,  7,  8, 10,  4,  7, 10,  6,  7, 10,  8,
   8, 10,  8,  9, 10,  9,  9, 10,  9,  9,  9,  2,  6, 10,  4,  7,
  10,  7,  8,  9,  5,  7, 10,  6,  7, 10,  8,  8,  9,  8,  9, 10,
@@ -414,7 +414,7 @@ static const uint8_t rv40_table_0_0_8[OT
   7,  8,  8,  8,  8,  9,  8,  8,  8,  7,  7,  7
 };
 
-static const uint8_t rv40_table_0_0_9[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_0_9[FIRSTBLK_VLC_SIZE] = {
   0, 10,  5, 10,  7, 12,  9, 11,  8, 13,  9, 12, 10, 13, 11, 12,
  16, 16, 14, 15, 15, 16, 13, 14,  5, 12,  6, 11,  9, 13, 10, 11,
   9, 14,  9, 12, 11, 14, 11, 12, 16, 16, 14, 15, 15, 16, 13, 13,
@@ -471,7 +471,7 @@ static const uint8_t rv40_table_0_0_9[FI
  10, 14,  9, 11, 10, 12,  8,  8, 12, 14,  9, 10, 10, 11,  8,  7,
 };
 
-static const uint8_t rv40_table_0_0_10[2][OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_0_10[2][OTHERBLK_VLC_SIZE] = {
 { 0,  5, 11,  3,  6, 11,  8,  9, 11,  3,  6, 10,  6,  7, 11,  9,
   9, 11,  7,  9, 11,  9,  9, 11, 10, 10, 11,  2,  6, 10,  4,  7,
  10,  7,  9, 11,  4,  7, 11,  6,  7, 10,  9,  9, 11,  7,  9, 11,
@@ -488,13 +488,13 @@ static const uint8_t rv40_table_0_0_10[2
   9, 10, 11, 10, 11, 12, 10, 10, 12, 10, 10, 10 }
 };
 
-static const uint8_t rv40_table_0_0_11[COEFF_VLC_SIZE] = {
+static const uint8_t rv34_table_0_0_11[COEFF_VLC_SIZE] = {
   1,  3,  3,  4,  4,  5,  6,  6,  6,  7,  7,  7,  8,  8,  9,  9,
   9,  9, 10, 10, 10, 11, 11, 11, 10, 10, 10, 12, 13, 14, 15, 15,
 };
 
 // BLOCK 1
-static const uint8_t rv40_table_0_1_0[CBPPAT_VLC_SIZE] =
+static const uint8_t rv34_table_0_1_0[CBPPAT_VLC_SIZE] =
  {  12, 12, 11,  9, 11, 10, 11,  9, 11, 11, 10,  9,  9,  8,  9,  5,
  14, 13, 14, 11, 14, 11, 13, 10, 14, 13, 12, 10, 12, 10, 11,  6,
  16, 13, 16, 12, 16, 12, 16, 11, 16, 14, 16, 12, 15, 12, 13,  8,
@@ -578,14 +578,14 @@ static const uint8_t rv40_table_0_1_0[CB
  16, 16, 16, 13, 16, 13, 14, 10, 16, 14, 12,  9, 12, 10,  9,  3,
 };
 
-static const uint8_t rv40_table_0_1_1[4][CBP_VLC_SIZE] = {
+static const uint8_t rv34_table_0_1_1[4][CBP_VLC_SIZE] = {
  { 0,  4,  3,  4,  3,  4,  5,  4,  3,  5,  4,  5,  3,  5,  5,  5 },
  { 0,  4,  4,  4,  4,  4,  5,  4,  4,  5,  4,  4,  3,  4,  4,  3 },
  { 0,  4,  4,  4,  4,  4,  5,  4,  4,  5,  5,  5,  4,  4,  4,  2 },
  { 0,  5,  6,  5,  5,  5,  6,  4,  6,  6,  5,  4,  5,  4,  4,  1 }
 };
 
-static const uint8_t rv40_table_0_1_2[CBPPAT_VLC_SIZE] =  {
+static const uint8_t rv34_table_0_1_2[CBPPAT_VLC_SIZE] =  {
   2,  6,  6,  7,  6,  7,  8,  7,  7,  8,  7,  8,  7,  8,  8,  5,
   5,  8,  9,  9,  9,  9, 12, 10, 10, 11, 10, 10, 10, 11, 11,  8,
   9, 10, 13, 12, 13, 12, 15, 13, 13, 14, 13, 14, 13, 13, 14, 11,
@@ -669,14 +669,14 @@ static const uint8_t rv40_table_0_1_2[CB
   7, 10, 10, 10, 10, 10, 11, 10, 10, 11, 10, 10, 10, 10, 10,  7,
 };
 
-static const uint8_t rv40_table_0_1_3[4][FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_1_3[4][FIRSTBLK_VLC_SIZE] = {
  { 0,  2,  3,  4,  2,  5,  6,  7,  3,  6,  5,  7,  4,  7,  8,  8 },
  { 0,  3,  3,  4,  3,  4,  5,  5,  3,  5,  4,  6,  3,  5,  6,  5 },
  { 0,  3,  3,  4,  3,  4,  5,  5,  3,  5,  4,  5,  4,  5,  5,  4 },
  { 0,  4,  4,  4,  4,  4,  5,  4,  4,  5,  5,  4,  4,  4,  5,  2 }
 };
 
-static const uint8_t rv40_table_0_1_4[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_1_4[FIRSTBLK_VLC_SIZE] = {
   0, 10,  5, 10,  6, 11,  8, 10,  7, 12,  8, 11,  9, 12,  9, 10,
  14, 16, 13, 13, 13, 14, 12, 11,  5, 12,  6, 10,  8, 12,  9, 10,
   8, 13,  8, 11,  9, 12,  9, 10, 14, 16, 12, 13, 13, 14, 11, 11,
@@ -733,7 +733,7 @@ static const uint8_t rv40_table_0_1_4[FI
  11, 15,  9, 11, 10, 12,  9,  7, 13, 15,  9,  9, 10, 10,  7,  5,
 };
 
-static const uint8_t rv40_table_0_1_5[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_1_5[FIRSTBLK_VLC_SIZE] = {
   0,  7,  3,  8,  4,  9,  7,  8,  5, 10,  7, 10,  8, 11,  8,  9,
  16, 16, 16, 16, 16, 16, 11, 10,  2, 10,  4,  9,  7, 10,  7,  8,
   7, 16,  7, 10,  9, 16,  8,  9, 16, 16, 16, 16, 16, 16, 11, 10,
@@ -790,7 +790,7 @@ static const uint8_t rv40_table_0_1_5[FI
  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 };
 
-static const uint8_t rv40_table_0_1_6[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_1_6[FIRSTBLK_VLC_SIZE] = {
   2,  9,  6,  9,  6, 10,  8,  9,  8, 12,  9, 11,  9, 12, 10, 10,
  16, 16, 14, 14, 15, 15, 13, 12,  5, 11,  7, 10,  8, 11,  9,  9,
   9, 13,  9, 11, 10, 12, 10, 10, 15, 16, 14, 14, 14, 16, 12, 11,
@@ -847,7 +847,7 @@ static const uint8_t rv40_table_0_1_6[FI
  12, 16, 11, 13, 11, 14, 10, 10, 14, 16, 11, 13, 12, 13, 10,  8,
 };
 
-static const uint8_t rv40_table_0_1_7[OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_1_7[OTHERBLK_VLC_SIZE] = {
   0,  5, 10,  4,  6, 10,  7,  8, 10,  4,  6, 10,  6,  7,  9,  8,
   8,  9,  8,  8,  9,  8,  9,  9,  9,  9,  9,  2,  6, 10,  4,  6,
  10,  7,  7,  9,  5,  7, 10,  6,  7,  9,  7,  7,  9,  7,  8,  9,
@@ -857,7 +857,7 @@ static const uint8_t rv40_table_0_1_7[OT
   7,  7,  8,  8,  8,  9,  8,  8,  8,  7,  7,  6
 };
 
-static const uint8_t rv40_table_0_1_8[OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_1_8[OTHERBLK_VLC_SIZE] = {
   0,  5, 10,  3,  6, 10,  7,  8, 10,  4,  7, 10,  6,  7, 10,  8,
   9, 10,  8,  9, 11,  8,  9, 10, 10, 10, 10,  2,  6, 10,  4,  6,
  10,  7,  8, 10,  4,  7, 10,  5,  7, 10,  8,  8, 10,  8,  9, 10,
@@ -867,7 +867,7 @@ static const uint8_t rv40_table_0_1_8[OT
   8,  8, 10,  9,  9, 10,  9,  9, 10,  9,  9,  9
 };
 
-static const uint8_t rv40_table_0_1_9[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_1_9[FIRSTBLK_VLC_SIZE] = {
   0, 11,  5, 11,  7, 13, 10, 12,  7, 13,  9, 13, 10, 14, 12, 13,
  16, 16, 15, 16, 16, 16, 15, 15,  4, 13,  6, 12, 10, 14, 11, 12,
   8, 14,  9, 13, 11, 15, 12, 13, 16, 16, 15, 16, 15, 16, 15, 14,
@@ -924,7 +924,7 @@ static const uint8_t rv40_table_0_1_9[FI
  11, 14, 10, 12, 10, 13,  9,  9, 13, 15, 10, 11, 11, 12,  9,  8,
 };
 
-static const uint8_t rv40_table_0_1_10[2][OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_1_10[2][OTHERBLK_VLC_SIZE] = {
 { 0,  5, 12,  4,  7, 12,  8, 10, 13,  4,  7, 12,  6,  8, 12, 10,
  10, 12,  8,  9, 12, 10, 10, 12, 12, 12, 12,  1,  6, 12,  4,  7,
  12,  8,  9, 12,  4,  7, 12,  6,  8, 11,  9, 10, 12,  8,  9, 12,
@@ -941,13 +941,13 @@ static const uint8_t rv40_table_0_1_10[2
  11, 12, 14, 12, 14, 15, 13, 13, 14, 13, 13, 14 }
 };
 
-static const uint8_t rv40_table_0_1_11[COEFF_VLC_SIZE] = {
+static const uint8_t rv34_table_0_1_11[COEFF_VLC_SIZE] = {
   1,  2,  3,  5,  5,  6,  6,  7,  7,  8,  8,  9, 10, 10, 10, 11,
  11, 11, 12, 12, 13, 13, 13, 13, 13, 13, 13, 14, 16, 16, 16, 16,
 };
 
 // BLOCK 2
-static const uint8_t rv40_table_0_2_0[CBPPAT_VLC_SIZE] = {
+static const uint8_t rv34_table_0_2_0[CBPPAT_VLC_SIZE] = {
  10, 10,  9,  8,  9,  8,  9,  7,  9,  9,  8,  7,  8,  7,  7,  4,
  13, 11, 12,  9, 12,  9, 12,  9, 12, 11, 11,  9, 10,  9,  9,  6,
  15, 12, 15, 11, 14, 10, 14, 10, 14, 13, 13, 11, 13, 11, 12,  7,
@@ -1031,14 +1031,14 @@ static const uint8_t rv40_table_0_2_0[CB
  16, 16, 16, 13, 16, 13, 15, 10, 15, 14, 13, 10, 13, 10, 10,  4,
 };
 
-static const uint8_t rv40_table_0_2_1[4][CBP_VLC_SIZE] = {
+static const uint8_t rv34_table_0_2_1[4][CBP_VLC_SIZE] = {
  { 0,  3,  3,  4,  3,  4,  4,  5,  3,  5,  4,  5,  4,  5,  5,  5 },
  { 0,  4,  4,  4,  4,  4,  5,  4,  3,  5,  4,  4,  4,  4,  4,  3 },
  { 0,  4,  4,  4,  3,  4,  5,  4,  4,  5,  4,  4,  4,  4,  4,  3 },
  { 0,  5,  5,  5,  5,  5,  6,  4,  5,  6,  5,  5,  5,  4,  4,  1 }
 };
 
-static const uint8_t rv40_table_0_2_2[CBPPAT_VLC_SIZE] = {
+static const uint8_t rv34_table_0_2_2[CBPPAT_VLC_SIZE] = {
   1,  6,  6,  7,  6,  7,  9,  8,  7,  9,  7,  8,  7,  8,  8,  6,
   6,  9, 10, 10, 10, 10, 12, 11, 10, 12, 11, 11, 11, 11, 12,  9,
   9, 10, 13, 11, 13, 12, 14, 13, 14, 14, 14, 14, 14, 14, 14, 12,
@@ -1122,14 +1122,14 @@ static const uint8_t rv40_table_0_2_2[CB
   8, 11, 11, 11, 11, 12, 13, 12, 11, 13, 11, 12, 11, 12, 12,  9,
 };
 
-static const uint8_t rv40_table_0_2_3[4][CBP_VLC_SIZE] = {
+static const uint8_t rv34_table_0_2_3[4][CBP_VLC_SIZE] = {
  { 0,  2,  3,  4,  2,  4,  6,  7,  3,  6,  5,  7,  5,  7,  8,  8 },
  { 0,  3,  3,  4,  3,  3,  6,  6,  3,  6,  4,  6,  3,  6,  6,  5 },
  { 0,  3,  3,  4,  3,  4,  5,  5,  3,  5,  4,  5,  4,  5,  5,  4 },
  { 0,  4,  4,  4,  4,  4,  6,  4,  4,  6,  5,  4,  4,  4,  4,  2 }
 };
 
-static const uint8_t rv40_table_0_2_4[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_2_4[FIRSTBLK_VLC_SIZE] = {
   0, 10,  5, 10,  6, 11,  8, 10,  7, 12,  8, 11,  8, 12,  9, 10,
  14, 16, 13, 13, 13, 14, 12, 11,  4, 12,  6, 10,  8, 12,  9, 10,
   8, 13,  8, 11,  9, 12,  9, 10, 14, 16, 12, 13, 13, 14, 11, 11,
@@ -1186,7 +1186,7 @@ static const uint8_t rv40_table_0_2_4[FI
  11, 15, 10, 11, 11, 12,  9,  8, 13, 15, 10, 10, 10, 11,  8,  7,
 };
 
-static const uint8_t rv40_table_0_2_5[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_2_5[FIRSTBLK_VLC_SIZE] = {
   0,  9,  3,  8,  5,  9,  7,  8,  5, 11,  6,  9,  8, 11,  8,  9,
  16, 16, 16, 16, 16, 16, 11, 10,  2, 10,  4,  9,  7, 10,  7,  8,
   7, 16,  7, 10,  9, 11,  8,  9, 16, 16, 11, 16, 16, 16, 11, 10,
@@ -1243,7 +1243,7 @@ static const uint8_t rv40_table_0_2_5[FI
  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 };
 
-static const uint8_t rv40_table_0_2_6[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_2_6[FIRSTBLK_VLC_SIZE] = {
   1, 10,  6, 10,  7, 11,  9, 10,  8, 12,  9, 12,  9, 12, 10, 10,
  16, 16, 14, 16, 14, 15, 13, 12,  5, 12,  7, 10,  9, 11,  9, 10,
   9, 13,  9, 12, 10, 13, 10, 10, 16, 16, 14, 15, 14, 14, 13, 12,
@@ -1300,7 +1300,7 @@ static const uint8_t rv40_table_0_2_6[FI
  12, 16, 11, 15, 12, 14, 11, 11, 13, 16, 12, 13, 11, 13, 10,  9,
 };
 
-static const uint8_t rv40_table_0_2_7[OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_2_7[OTHERBLK_VLC_SIZE] = {
   0,  5, 10,  3,  6, 10,  7,  8, 11,  4,  6, 10,  6,  7, 10,  8,
   9, 10,  8,  8, 10,  9,  9, 10, 10, 10, 10,  2,  6, 10,  4,  6,
  10,  7,  8, 10,  4,  7, 10,  6,  7, 10,  8,  8, 10,  7,  8, 10,
@@ -1310,7 +1310,7 @@ static const uint8_t rv40_table_0_2_7[OT
   8,  8,  9,  8,  9, 10,  8,  8,  9,  9,  8,  8
 };
 
-static const uint8_t rv40_table_0_2_8[OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_2_8[OTHERBLK_VLC_SIZE] = {
   0,  5, 11,  3,  6, 11,  7,  9, 11,  4,  6, 11,  5,  7, 10,  9,
   9, 11,  8,  9, 11,  9, 10, 11, 11, 11, 11,  2,  6, 10,  3,  6,
  10,  7,  9, 11,  4,  7, 10,  5,  7, 10,  8,  9, 11,  8,  9, 11,
@@ -1320,7 +1320,7 @@ static const uint8_t rv40_table_0_2_8[OT
  10, 11, 12, 10, 11, 12, 10, 10, 11, 11, 11, 11
 };
 
-static const uint8_t rv40_table_0_2_9[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_2_9[FIRSTBLK_VLC_SIZE] = {
   0, 12,  6, 13,  7, 14, 11, 14,  8, 14, 10, 14, 11, 15, 13, 15,
  16, 16, 16, 16, 16, 16, 16, 16,  5, 14,  7, 13, 10, 16, 12, 14,
   9, 16, 10, 14, 12, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16,
@@ -1377,7 +1377,7 @@ static const uint8_t rv40_table_0_2_9[FI
  12, 16, 11, 13, 11, 14, 11, 11, 13, 16, 12, 13, 12, 14, 11, 11,
 };
 
-static const uint8_t rv40_table_0_2_10[2][OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_2_10[2][OTHERBLK_VLC_SIZE] = {
 { 0,  6, 13,  4,  7, 14,  9, 11, 14,  3,  7, 13,  7,  8, 13, 11,
  11, 14,  8, 10, 13, 10, 11, 13, 13, 13, 14,  1,  6, 12,  4,  8,
  13,  9, 10, 15,  4,  8, 13,  7,  8, 12, 11, 11, 14,  8, 10, 13,
@@ -1394,13 +1394,13 @@ static const uint8_t rv40_table_0_2_10[2
  16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 16, 16 }
 };
 
-static const uint8_t rv40_table_0_2_11[COEFF_VLC_SIZE] = {
+static const uint8_t rv34_table_0_2_11[COEFF_VLC_SIZE] = {
   1,  2,  3,  4,  5,  6,  8,  8,  9,  9, 10, 10, 11, 12, 12, 12,
  13, 13, 14, 14, 14, 14, 16, 16, 14, 16, 16, 16, 14, 16, 16, 16,
 };
 
 // BLOCK 3
-static const uint8_t rv40_table_0_3_0[CBPPAT_VLC_SIZE] = {
+static const uint8_t rv34_table_0_3_0[CBPPAT_VLC_SIZE] = {
   8,  8,  8,  7,  8,  7,  8,  6,  8,  8,  7,  6,  7,  6,  6,  4,
  11, 10, 11,  9, 11,  9, 11,  8, 11, 10, 10,  9, 10,  8,  9,  6,
  13, 11, 13, 10, 12, 10, 13,  9, 13, 12, 13, 10, 12, 10, 11,  7,
@@ -1484,14 +1484,14 @@ static const uint8_t rv40_table_0_3_0[CB
  16, 16, 15, 13, 16, 14, 14, 11, 15, 14, 13, 10, 13, 11, 10,  5,
 };
 
-static const uint8_t rv40_table_0_3_1[4][CBP_VLC_SIZE] = {
+static const uint8_t rv34_table_0_3_1[4][CBP_VLC_SIZE] = {
  { 0,  3,  3,  4,  3,  4,  4,  5,  3,  5,  4,  5,  4,  5,  5,  5 },
  { 0,  3,  3,  4,  3,  4,  5,  5,  3,  5,  4,  5,  4,  5,  5,  4 },
  { 0,  3,  4,  4,  3,  4,  5,  4,  4,  5,  4,  5,  4,  5,  4,  3 },
  { 0,  4,  5,  4,  4,  4,  5,  4,  4,  5,  5,  4,  4,  4,  4,  2 }
 };
 
-static const uint8_t rv40_table_0_3_2[CBPPAT_VLC_SIZE] = {
+static const uint8_t rv34_table_0_3_2[CBPPAT_VLC_SIZE] = {
   1,  6,  6,  7,  6,  7,  9,  7,  6,  9,  7,  8,  7,  8,  8,  5,
   5,  8, 10, 10, 10, 10, 12, 11, 11, 12, 11, 11, 11, 12, 12,  9,
   9, 10, 12, 11, 13, 12, 15, 13, 14, 15, 15, 14, 14, 15, 15, 12,
@@ -1575,14 +1575,14 @@ static const uint8_t rv40_table_0_3_2[CB
   8, 11, 11, 12, 12, 12, 13, 12, 11, 13, 12, 12, 12, 13, 12, 10,
 };
 
-static const uint8_t rv40_table_0_3_3[4][CBP_VLC_SIZE] = {
+static const uint8_t rv34_table_0_3_3[4][CBP_VLC_SIZE] = {
  { 0,  2,  3,  4,  2,  4,  7,  6,  3,  7,  5,  7,  5,  7,  7,  7 },
  { 0,  3,  3,  3,  3,  4,  6,  6,  3,  6,  4,  6,  3,  6,  6,  5 },
  { 0,  3,  3,  4,  3,  4,  5,  5,  3,  5,  4,  5,  4,  5,  5,  4 },
  { 0,  4,  4,  4,  4,  5,  5,  4,  4,  5,  5,  4,  4,  4,  4,  2 }
 };
 
-static const uint8_t rv40_table_0_3_4[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_3_4[FIRSTBLK_VLC_SIZE] = {
   0, 10,  5, 10,  5, 10,  8, 10,  6, 11,  8, 11,  8, 11,  9, 10,
  14, 16, 13, 14, 13, 14, 12, 12,  4, 12,  5, 10,  8, 12,  9, 10,
   7, 12,  8, 11,  9, 12,  9, 10, 14, 16, 12, 13, 13, 14, 12, 12,
@@ -1639,7 +1639,7 @@ static const uint8_t rv40_table_0_3_4[FI
  12, 15, 11, 12, 12, 13, 10, 10, 14, 15, 11, 11, 12, 12, 10,  9,
 };
 
-static const uint8_t rv40_table_0_3_5[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_3_5[FIRSTBLK_VLC_SIZE] = {
   0,  8,  3,  8,  5,  9,  7,  8,  5, 10,  6, 10,  8, 11,  8,  9,
  16, 16, 15, 16, 16, 16, 11, 11,  2, 10,  4,  9,  7, 10,  7,  8,
   7, 16,  7, 10,  9, 11,  8,  9, 16, 16, 15, 16, 16, 16, 11, 11,
@@ -1696,7 +1696,7 @@ static const uint8_t rv40_table_0_3_5[FI
  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 };
 
-static const uint8_t rv40_table_0_3_6[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_3_6[FIRSTBLK_VLC_SIZE] = {
   1, 10,  6, 10,  7, 11,  9, 10,  8, 12,  9, 12,  9, 12, 10, 10,
  15, 16, 14, 15, 14, 16, 13, 12,  5, 12,  7, 11,  8, 11,  9, 10,
   9, 13,  9, 12, 10, 12, 10, 10, 16, 16, 14, 15, 13, 16, 13, 12,
@@ -1753,7 +1753,7 @@ static const uint8_t rv40_table_0_3_6[FI
  13, 16, 12, 16, 12, 15, 12, 12, 14, 16, 12, 14, 12, 14, 11, 10,
 };
 
-static const uint8_t rv40_table_0_3_7[OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_3_7[OTHERBLK_VLC_SIZE] = {
   0,  5, 11,  3,  6, 11,  7,  9, 12,  3,  6, 11,  6,  7, 11,  9,
   9, 11,  8,  9, 11,  9,  9, 11, 11, 11, 12,  2,  6, 11,  4,  6,
  11,  7,  9, 11,  4,  7, 11,  5,  7, 10,  9,  9, 11,  7,  8, 11,
@@ -1763,7 +1763,7 @@ static const uint8_t rv40_table_0_3_7[OT
  10, 10, 12,  9, 10, 12,  9,  9, 11, 11, 10, 11
 };
 
-static const uint8_t rv40_table_0_3_8[OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_3_8[OTHERBLK_VLC_SIZE] = {
   0,  6, 11,  3,  7, 11,  8, 10, 12,  4,  7, 11,  6,  8, 11, 10,
  11, 12,  9, 10, 12, 10, 10, 12, 12, 12, 13,  1,  6, 11,  4,  7,
  11,  8, 10, 12,  4,  7, 11,  6,  8, 11, 10, 10, 12,  9, 10, 12,
@@ -1773,7 +1773,7 @@ static const uint8_t rv40_table_0_3_8[OT
  13, 13, 14, 12, 13, 15, 13, 13, 14, 14, 14, 14
 };
 
-static const uint8_t rv40_table_0_3_9[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_3_9[FIRSTBLK_VLC_SIZE] = {
   0, 13,  6, 13,  8, 14, 12, 16,  8, 16, 11, 16, 12, 16, 14, 16,
  16, 16, 16, 16, 16, 16, 16, 16,  4, 16,  7, 14, 11, 16, 13, 16,
   9, 16, 11, 16, 12, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16,
@@ -1830,7 +1830,7 @@ static const uint8_t rv40_table_0_3_9[FI
  12, 16, 12, 16, 12, 16, 12, 13, 16, 16, 13, 14, 13, 16, 13, 13,
 };
 
-static const uint8_t rv40_table_0_3_10[2][OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_3_10[2][OTHERBLK_VLC_SIZE] = {
 { 0,  6, 13,  3,  8, 14, 10, 12, 16,  3,  8, 15,  7,  9, 15, 12,
  13, 15,  9, 11, 15, 11, 12, 16, 14, 16, 16,  1,  7, 13,  4,  8,
  14,  9, 11, 15,  4,  8, 14,  7,  9, 14, 12, 13, 15,  8, 10, 14,
@@ -1847,13 +1847,13 @@ static const uint8_t rv40_table_0_3_10[2
  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 }
 };
 
-static const uint8_t rv40_table_0_3_11[COEFF_VLC_SIZE] = {
+static const uint8_t rv34_table_0_3_11[COEFF_VLC_SIZE] = {
   1,  2,  3,  4,  5,  6,  8,  8,  9,  9, 10, 10, 11, 12, 12, 12,
  13, 13, 16, 16, 16, 16, 16, 16, 16, 16, 14, 12, 16, 16, 16, 16,
 };
 
 // BLOCK 4
-static const uint8_t rv40_table_0_4_0[CBPPAT_VLC_SIZE] = {
+static const uint8_t rv34_table_0_4_0[CBPPAT_VLC_SIZE] = {
   5,  6,  6,  6,  6,  6,  7,  6,  6,  7,  6,  6,  6,  6,  6,  4,
   9,  9,  9,  8,  9,  8, 10,  8, 10, 10,  9,  9,  9,  8,  9,  6,
  11, 10, 12, 10, 11, 10, 12,  9, 12, 11, 11, 10, 11, 10, 11,  8,
@@ -1937,14 +1937,14 @@ static const uint8_t rv40_table_0_4_0[CB
  15, 15, 14, 13, 15, 13, 14, 12, 14, 14, 13, 11, 13, 11, 11,  7,
 };
 
-static const uint8_t rv40_table_0_4_1[4][CBP_VLC_SIZE] = {
+static const uint8_t rv34_table_0_4_1[4][CBP_VLC_SIZE] = {
  { 0,  3,  3,  4,  3,  4,  5,  6,  2,  5,  4,  7,  4,  6,  6,  7 },
  { 0,  3,  3,  4,  3,  4,  5,  5,  3,  5,  4,  5,  4,  5,  5,  4 },
  { 0,  3,  3,  4,  3,  4,  5,  5,  3,  5,  4,  5,  4,  5,  5,  4 },
  { 0,  4,  4,  4,  4,  5,  5,  4,  4,  5,  5,  4,  4,  4,  4,  2 }
 };
 
-static const uint8_t rv40_table_0_4_2[CBPPAT_VLC_SIZE] = {
+static const uint8_t rv34_table_0_4_2[CBPPAT_VLC_SIZE] = {
   1,  5,  6,  7,  6,  7,  9,  8,  6,  9,  8,  8,  7,  8,  8,  6,
   5,  8, 10, 10, 10, 11, 13, 12, 11, 13, 12, 12, 12, 12, 13, 10,
   8, 10, 13, 12, 13, 13, 16, 14, 14, 16, 16, 14, 16, 16, 16, 12,
@@ -2028,14 +2028,14 @@ static const uint8_t rv40_table_0_4_2[CB
   8, 12, 12, 13, 12, 14, 14, 14, 12, 16, 13, 14, 12, 14, 14, 11,
 };
 
-static const uint8_t rv40_table_0_4_3[4][CBP_VLC_SIZE] = {
+static const uint8_t rv34_table_0_4_3[4][CBP_VLC_SIZE] = {
  { 0,  2,  3,  4,  2,  4,  6,  7,  3,  7,  5,  7,  5,  7,  7,  7 },
  { 0,  2,  3,  4,  3,  4,  6,  5,  3,  6,  4,  6,  4,  6,  6,  6 },
  { 0,  3,  3,  4,  3,  4,  5,  5,  3,  5,  4,  5,  4,  5,  5,  4 },
  { 0,  3,  4,  4,  4,  4,  5,  4,  4,  5,  4,  4,  4,  4,  4,  3 }
 };
 
-static const uint8_t rv40_table_0_4_4[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_4_4[FIRSTBLK_VLC_SIZE] = {
   0, 10,  4, 10,  5, 11,  9, 11,  6, 11,  8, 11,  8, 12, 10, 12,
  15, 16, 13, 15, 14, 15, 13, 14,  4, 12,  5, 11,  8, 12,  9, 11,
   7, 13,  8, 12,  9, 13, 10, 12, 15, 16, 13, 15, 14, 16, 13, 14,
@@ -2092,7 +2092,7 @@ static const uint8_t rv40_table_0_4_4[FI
  13, 16, 13, 14, 14, 16, 12, 13, 16, 16, 14, 14, 14, 15, 13, 13,
 };
 
-static const uint8_t rv40_table_0_4_5[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_4_5[FIRSTBLK_VLC_SIZE] = {
   0,  9,  3,  9,  5,  9,  7,  9,  5, 10,  7, 11,  8, 11,  9, 10,
  16, 16, 16, 16, 16, 16, 16, 16,  2, 11,  4, 10,  7, 11,  8, 10,
   7, 16,  7, 11,  9, 16,  9, 11, 16, 16, 16, 16, 16, 16, 16, 16,
@@ -2149,7 +2149,7 @@ static const uint8_t rv40_table_0_4_5[FI
  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 };
 
-static const uint8_t rv40_table_0_4_6[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_4_6[FIRSTBLK_VLC_SIZE] = {
   1, 10,  5, 10,  6, 10,  9, 10,  7, 12,  9, 12,  9, 12, 10, 10,
  16, 16, 15, 16, 14, 16, 13, 13,  5, 12,  7, 11,  8, 11,  9, 10,
   8, 13,  9, 12, 10, 12, 10, 11, 16, 16, 16, 16, 14, 16, 13, 12,
@@ -2206,7 +2206,7 @@ static const uint8_t rv40_table_0_4_6[FI
  13, 16, 12, 16, 12, 16, 12, 12, 14, 16, 13, 15, 13, 16, 12, 11,
 };
 
-static const uint8_t rv40_table_0_4_7[OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_4_7[OTHERBLK_VLC_SIZE] = {
   0,  6, 12,  3,  7, 12,  9, 11, 13,  4,  7, 12,  6,  8, 12, 10,
  11, 13,  8, 10, 13, 10, 11, 13, 13, 13, 14,  1,  6, 12,  4,  7,
  12,  9, 10, 14,  4,  7, 12,  6,  7, 12, 10, 11, 13,  8,  9, 13,
@@ -2216,7 +2216,7 @@ static const uint8_t rv40_table_0_4_7[OT
  12, 13, 15, 11, 13, 15, 12, 12, 15, 14, 14, 14
 };
 
-static const uint8_t rv40_table_0_4_8[OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_4_8[OTHERBLK_VLC_SIZE] = {
   0,  5, 11,  3,  6, 11, 10, 10, 12,  3,  7, 11,  6,  8, 11, 11,
  11, 12, 10, 10, 12, 11, 11, 13, 14, 13, 14,  1,  6, 11,  4,  7,
  11, 10, 11, 13,  5,  7, 11,  7,  8, 11, 11, 11, 13, 10, 11, 13,
@@ -2226,7 +2226,7 @@ static const uint8_t rv40_table_0_4_8[OT
  14, 13, 16, 13, 13, 16, 13, 14, 15, 15, 14, 15
 };
 
-static const uint8_t rv40_table_0_4_9[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_4_9[FIRSTBLK_VLC_SIZE] = {
   0, 16,  6, 16,  8, 16, 16, 16,  9, 16, 11, 16, 12, 16, 16, 16,
  16, 16, 16, 16, 16, 16, 16, 16,  4, 16,  7, 16, 11, 16, 16, 16,
  10, 16, 11, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
@@ -2283,7 +2283,7 @@ static const uint8_t rv40_table_0_4_9[FI
  13, 16, 12, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 };
 
-static const uint8_t rv40_table_0_4_10[2][OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_0_4_10[2][OTHERBLK_VLC_SIZE] = {
 { 0,  6, 16,  3,  8, 16, 10, 13, 16,  3,  8, 16,  7,  9, 16, 13,
  16, 16,  8, 10, 16, 11, 13, 16, 16, 16, 16,  1,  7, 14,  4,  8,
  16, 10, 12, 16,  4,  8, 13,  7,  9, 16, 13, 14, 16,  8, 10, 16,
@@ -2300,14 +2300,14 @@ static const uint8_t rv40_table_0_4_10[2
  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 }
 };
 
-static const uint8_t rv40_table_0_4_11[COEFF_VLC_SIZE] = {
+static const uint8_t rv34_table_0_4_11[COEFF_VLC_SIZE] = {
   1,  2,  3,  4,  5,  7,  7,  8,  8,  9, 10, 10, 12, 11, 13, 12,
  15, 13, 14, 13, 12, 15, 14, 13, 12, 12, 10, 11, 16, 16, 16, 16,
 };
 
 // INTER TABLES
 // BLOCK 0
-static const uint8_t rv40_table_1_0_0[CBPPAT_VLC_SIZE] = {
+static const uint8_t rv34_table_1_0_0[CBPPAT_VLC_SIZE] = {
   7,  9,  9,  8,  9,  8,  9,  8,  9,  9,  8,  8,  8,  8,  8,  4,
   7, 10, 11, 10, 11, 10, 12, 10, 12, 11, 11, 10, 11, 10, 10,  7,
  10, 11, 15, 12, 15, 12, 15, 12, 15, 14, 14, 12, 14, 12, 14,  9,
@@ -2391,14 +2391,14 @@ static const uint8_t rv40_table_1_0_0[CB
  10, 13, 13, 11, 13, 12, 13,  9, 13, 13, 12,  9, 12, 10, 10,  3,
 };
 
-static const uint8_t rv40_table_1_0_1[4][CBP_VLC_SIZE] = {
+static const uint8_t rv34_table_1_0_1[4][CBP_VLC_SIZE] = {
  { 0,  6,  6,  3,  6,  4,  5,  3,  6,  5,  4,  3,  3,  4,  4,  3 },
  { 0,  6,  6,  4,  6,  4,  5,  3,  6,  5,  4,  3,  4,  4,  4,  2 },
  { 0,  7,  7,  4,  7,  5,  5,  4,  7,  5,  5,  4,  5,  4,  4,  1 },
  { 0,  7,  7,  5,  7,  5,  6,  4,  7,  6,  5,  3,  5,  4,  4,  1 }
 };
 
-static const uint8_t rv40_table_1_0_2[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_0_2[FIRSTBLK_VLC_SIZE] = {
   0,  7,  5,  7,  5,  7,  6,  6,  7, 10,  7,  9,  8,  9,  8,  7,
  12, 14, 11, 12, 12, 12, 11,  9,  6,  9,  6,  8,  7,  9,  7,  7,
   8, 11,  8,  9,  9, 10,  9,  8, 13, 15, 12, 12, 12, 13, 11,  9,
@@ -2455,7 +2455,7 @@ static const uint8_t rv40_table_1_0_2[FI
  14, 16, 12, 12, 12, 13, 10,  7, 16, 16, 11, 11, 12, 11,  8,  5,
 };
 
-static const uint8_t rv40_table_1_0_3[2][OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_0_3[2][OTHERBLK_VLC_SIZE] = {
 { 0,  4,  8,  3,  6,  8,  6,  7,  8,  4,  6,  8,  6,  7,  8,  7,
   8,  8,  7,  8,  8,  8,  8,  8,  8,  8,  8,  3,  6,  8,  4,  6,
   9,  7,  7,  8,  5,  7,  9,  6,  7,  9,  8,  8,  8,  7,  8,  8,
@@ -2472,7 +2472,7 @@ static const uint8_t rv40_table_1_0_3[2]
   8,  8,  9,  8,  9,  9,  8,  9,  9,  8,  8,  7 }
 };
 
-static const uint8_t rv40_table_1_0_4[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_0_4[FIRSTBLK_VLC_SIZE] = {
   0,  7,  4,  8,  5,  8,  7,  8,  6, 10,  7, 10,  8, 10,  9,  9,
  13, 16, 12, 13, 13, 14, 12, 12,  4, 10,  6,  9,  8, 11,  8,  9,
   8, 12,  8, 11, 10, 12, 10, 10, 14, 16, 12, 13, 14, 15, 12, 12,
@@ -2528,7 +2528,7 @@ static const uint8_t rv40_table_1_0_4[FI
  16, 16, 14, 15, 14, 14, 12, 11, 14, 16, 12, 13, 13, 15, 11, 11,
  14, 16, 12, 13, 13, 14, 11, 11, 15, 16, 12, 13, 13, 13, 10,  9,
 };
-static const uint8_t rv40_table_1_0_5[2][OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_0_5[2][OTHERBLK_VLC_SIZE] = {
 { 0,  4,  9,  3,  6,  9,  7,  8, 10,  3,  6,  9,  5,  7, 10,  9,
   9, 10,  7,  8, 10,  8,  9, 10, 10, 10, 10,  2,  6,  9,  4,  7,
  10,  8,  9, 10,  4,  7, 10,  6,  7, 10,  9,  9, 10,  7,  8, 10,
@@ -2545,13 +2545,13 @@ static const uint8_t rv40_table_1_0_5[2]
  11, 11, 12, 11, 12, 12, 11, 12, 12, 12, 11, 11 }
 };
 
-static const uint8_t rv40_table_1_0_6[COEFF_VLC_SIZE] = {
+static const uint8_t rv34_table_1_0_6[COEFF_VLC_SIZE] = {
   1,  2,  4,  4,  5,  5,  6,  7,  7,  7,  8,  8,  8,  9,  9, 10,
  10, 10, 10, 11, 11, 11, 11, 12, 11, 11, 11, 13, 14, 15, 16, 16,
 };
 
 // BLOCK 2
-static const uint8_t rv40_table_1_1_0[CBPPAT_VLC_SIZE] = {
+static const uint8_t rv34_table_1_1_0[CBPPAT_VLC_SIZE] = {
   5,  7,  7,  7,  7,  7,  8,  7,  7,  8,  7,  7,  7,  7,  7,  4,
   7,  9, 11,  9, 11,  9, 11,  9, 11, 10, 10,  9, 10,  9, 10,  6,
  11, 11, 14, 11, 14, 11, 14, 11, 15, 13, 14, 12, 14, 12, 13,  9,
@@ -2635,14 +2635,14 @@ static const uint8_t rv40_table_1_1_0[CB
  11, 14, 13, 12, 14, 12, 13, 10, 14, 13, 12, 10, 12, 10, 10,  4,
 };
 
-static const uint8_t rv40_table_1_1_1[4][CBP_VLC_SIZE] = {
+static const uint8_t rv34_table_1_1_1[4][CBP_VLC_SIZE] = {
  { 0,  6,  6,  3,  6,  3,  5,  4,  6,  5,  3,  4,  3,  4,  4,  3 },
  { 0,  6,  6,  4,  6,  4,  4,  4,  6,  4,  4,  3,  4,  4,  4,  2 },
  { 0,  6,  6,  4,  6,  4,  5,  4,  6,  5,  4,  3,  4,  4,  3,  2 },
  { 0,  7,  7,  5,  7,  5,  6,  4,  7,  6,  5,  3,  5,  4,  4,  1 }
 };
 
-static const uint8_t rv40_table_1_1_2[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_1_2[FIRSTBLK_VLC_SIZE] = {
   0,  7,  4,  7,  5,  7,  6,  6,  6, 10,  7,  8,  8,  9,  8,  7,
  13, 14, 11, 12, 12, 12, 11,  9,  5,  9,  6,  8,  7,  9,  7,  7,
   8, 11,  8,  9,  9, 10,  9,  8, 13, 16, 12, 12, 12, 13, 11,  9,
@@ -2699,7 +2699,7 @@ static const uint8_t rv40_table_1_1_2[FI
  14, 16, 12, 12, 12, 13, 10,  8, 15, 16, 11, 11, 11, 12,  9,  6,
 };
 
-static const uint8_t rv40_table_1_1_3[2][OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_1_3[2][OTHERBLK_VLC_SIZE] = {
 { 0,  4,  8,  3,  6,  8,  6,  7,  9,  4,  6,  8,  5,  7,  8,  8,
   8,  9,  7,  7,  8,  8,  8,  8,  8,  9,  8,  3,  6,  8,  4,  6,
   9,  7,  7,  9,  5,  6,  9,  6,  7,  9,  8,  8,  9,  7,  8,  8,
@@ -2716,7 +2716,7 @@ static const uint8_t rv40_table_1_1_3[2]
   9,  9, 10,  9,  9, 10,  9,  9, 10,  9,  9,  8 }
 };
 
-static const uint8_t rv40_table_1_1_4[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_1_4[FIRSTBLK_VLC_SIZE] = {
   0,  7,  4,  7,  5,  8,  7,  8,  5, 10,  7, 10,  8, 10,  9, 10,
  13, 16, 12, 14, 14, 14, 13, 12,  4, 10,  6,  9,  8, 11,  9,  9,
   8, 12,  8, 11, 10, 12, 10, 10, 14, 16, 13, 14, 14, 15, 13, 12,
@@ -2773,7 +2773,7 @@ static const uint8_t rv40_table_1_1_4[FI
  13, 16, 12, 14, 13, 15, 12, 12, 14, 16, 12, 13, 13, 14, 11, 10,
 };
 
-static const uint8_t rv40_table_1_1_5[2][OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_1_5[2][OTHERBLK_VLC_SIZE] = {
 { 0,  4,  9,  3,  6, 10,  8,  9, 11,  3,  5,  9,  5,  7, 10,  9,
  10, 11,  7,  8, 10,  9,  9, 11, 11, 11, 12,  2,  5, 10,  4,  7,
  10,  8,  9, 11,  4,  6, 10,  6,  7, 10,  9, 10, 11,  7,  9, 10,
@@ -2790,13 +2790,13 @@ static const uint8_t rv40_table_1_1_5[2]
  12, 12, 13, 12, 13, 14, 13, 13, 14, 13, 13, 13 }
 };
 
-static const uint8_t rv40_table_1_1_6[COEFF_VLC_SIZE] = {
+static const uint8_t rv34_table_1_1_6[COEFF_VLC_SIZE] = {
   1,  2,  3,  5,  5,  6,  6,  7,  7,  8,  9,  9,  9, 10, 10, 10,
  11, 11, 12, 12, 12, 12, 13, 13, 12, 12, 13, 14, 16, 16, 16, 16,
 };
 
 // BLOCK 2
-static const uint8_t rv40_table_1_2_0[CBPPAT_VLC_SIZE] = {
+static const uint8_t rv34_table_1_2_0[CBPPAT_VLC_SIZE] = {
   4,  6,  6,  6,  6,  6,  7,  6,  6,  7,  6,  6,  6,  6,  6,  3,
   6,  9, 10,  9, 10,  9, 11,  9, 10, 10, 10,  9, 10,  9, 10,  6,
  10, 11, 14, 11, 14, 11, 14, 11, 14, 13, 14, 11, 14, 11, 13,  9,
@@ -2880,14 +2880,14 @@ static const uint8_t rv40_table_1_2_0[CB
  11, 14, 14, 13, 14, 13, 14, 12, 13, 14, 13, 12, 13, 12, 12,  7,
 };
 
-static const uint8_t rv40_table_1_2_1[4][CBP_VLC_SIZE] = {
+static const uint8_t rv34_table_1_2_1[4][CBP_VLC_SIZE] = {
  { 0,  6,  6,  3,  6,  3,  5,  4,  6,  5,  3,  4,  3,  4,  4,  3 },
  { 0,  5,  5,  3,  5,  4,  5,  4,  5,  5,  4,  4,  4,  4,  4,  2 },
  { 0,  6,  6,  4,  6,  4,  5,  3,  6,  5,  4,  3,  4,  4,  4,  2 },
  { 0,  7,  7,  5,  7,  5,  6,  4,  7,  6,  5,  3,  5,  4,  4,  1 }
 };
 
-static const uint8_t rv40_table_1_2_2[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_2_2[FIRSTBLK_VLC_SIZE] = {
   0,  7,  4,  7,  5,  7,  6,  6,  6, 10,  7,  8,  8,  9,  8,  8,
  13, 14, 11, 12, 12, 12, 11, 10,  5,  9,  6,  8,  7,  9,  7,  7,
   8, 11,  8,  9,  9, 10,  9,  8, 13, 16, 12, 12, 13, 13, 11, 10,
@@ -2944,7 +2944,7 @@ static const uint8_t rv40_table_1_2_2[FI
  14, 16, 12, 13, 12, 13, 10,  9, 14, 16, 11, 11, 12, 12,  9,  7,
 };
 
-static const uint8_t rv40_table_1_2_3[2][OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_2_3[2][OTHERBLK_VLC_SIZE] = {
 { 0,  4,  8,  3,  6,  9,  7,  8,  9,  4,  6,  8,  5,  7,  9,  8,
   9,  9,  7,  8,  9,  8,  8,  9,  9,  9,  9,  2,  6,  9,  4,  6,
   9,  7,  8, 10,  5,  7,  9,  6,  7,  9,  8,  8,  9,  7,  8,  9,
@@ -2961,7 +2961,7 @@ static const uint8_t rv40_table_1_2_3[2]
  10, 11, 11,  9, 10, 11, 10, 11, 11, 10, 10, 10 }
 };
 
-static const uint8_t rv40_table_1_2_4[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_2_4[FIRSTBLK_VLC_SIZE] = {
   0,  7,  3,  8,  5,  8,  7,  9,  5, 10,  7, 10,  8, 11, 10, 10,
  14, 16, 14, 15, 14, 16, 14, 14,  4, 10,  6, 10,  8, 11,  9, 10,
   8, 12,  9, 11, 10, 12, 11, 11, 15, 16, 14, 16, 15, 16, 14, 14,
@@ -3018,7 +3018,7 @@ static const uint8_t rv40_table_1_2_4[FI
  13, 16, 13, 16, 14, 16, 13, 13, 15, 16, 13, 14, 13, 15, 12, 12,
 };
 
-static const uint8_t rv40_table_1_2_5[2][OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_2_5[2][OTHERBLK_VLC_SIZE] = {
 { 0,  4, 10,  3,  6, 10,  8, 10, 12,  2,  6, 10,  6,  8, 11, 10,
  11, 12,  7,  9, 11,  9, 10, 12, 12, 13, 13,  2,  6, 10,  4,  7,
  11,  9, 10, 13,  4,  7, 11,  7,  8, 11, 10, 11, 12,  8,  9, 12,
@@ -3035,13 +3035,13 @@ static const uint8_t rv40_table_1_2_5[2]
  14, 15, 16, 14, 16, 16, 15, 16, 16, 15, 15, 16 }
 };
 
-static const uint8_t rv40_table_1_2_6[COEFF_VLC_SIZE] = {
+static const uint8_t rv34_table_1_2_6[COEFF_VLC_SIZE] = {
   1,  2,  3,  4,  6,  6,  7,  7,  8,  8,  9,  9, 10, 10, 11, 12,
  12, 12, 13, 13, 13, 14, 14, 15, 14, 14, 16, 16, 16, 16, 16, 16,
 };
 
 // BLOCK 3
-static const uint8_t rv40_table_1_3_0[CBPPAT_VLC_SIZE] = {
+static const uint8_t rv34_table_1_3_0[CBPPAT_VLC_SIZE] = {
   2,  6,  6,  5,  6,  6,  7,  6,  6,  7,  6,  6,  6,  6,  6,  3,
   6,  9, 10,  9, 10,  9, 11,  9, 10, 10, 10,  9, 10,  9, 10,  7,
  10, 11, 14, 11, 14, 11, 14, 11, 14, 13, 14, 12, 14, 12, 13,  9,
@@ -3125,14 +3125,14 @@ static const uint8_t rv40_table_1_3_0[CB
  12, 15, 15, 14, 15, 14, 16, 14, 14, 16, 15, 13, 14, 13, 13,  9,
 };
 
-static const uint8_t rv40_table_1_3_1[4][CBP_VLC_SIZE] = {
+static const uint8_t rv34_table_1_3_1[4][CBP_VLC_SIZE] = {
  { 0,  6,  6,  3,  6,  3,  5,  4,  6,  5,  3,  4,  3,  4,  4,  3 },
  { 0,  5,  5,  3,  5,  4,  5,  4,  5,  5,  4,  4,  4,  4,  4,  2 },
  { 0,  6,  6,  4,  6,  4,  5,  3,  6,  5,  4,  3,  4,  4,  4,  2 },
  { 0,  7,  7,  4,  7,  5,  6,  4,  7,  6,  5,  4,  4,  4,  4,  1 }
 };
 
-static const uint8_t rv40_table_1_3_2[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_3_2[FIRSTBLK_VLC_SIZE] = {
   0,  7,  4,  6,  4,  7,  6,  7,  6,  9,  7,  8,  7,  9,  8,  8,
  13, 14, 12, 12, 12, 13, 11, 11,  5,  9,  5,  8,  7,  9,  7,  8,
   8, 11,  8, 10,  9, 10,  9,  9, 13, 15, 12, 13, 12, 13, 11, 11,
@@ -3189,7 +3189,7 @@ static const uint8_t rv40_table_1_3_2[FI
  13, 16, 12, 13, 12, 14, 11, 10, 14, 16, 11, 12, 12, 12, 10,  8,
 };
 
-static const uint8_t rv40_table_1_3_3[2][OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_3_3[2][OTHERBLK_VLC_SIZE] = {
 { 0,  4,  9,  3,  6,  9,  7,  8, 10,  3,  6,  9,  6,  7,  9,  9,
   9, 10,  7,  8,  9,  8,  9, 10, 10, 10, 11,  2,  6,  9,  4,  7,
  10,  7,  9, 10,  4,  7, 10,  6,  7, 10,  9,  9, 10,  7,  8, 10,
@@ -3206,7 +3206,7 @@ static const uint8_t rv40_table_1_3_3[2]
  11, 12, 13, 11, 12, 13, 11, 12, 13, 12, 13, 12 }
 };
 
-static const uint8_t rv40_table_1_3_4[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_3_4[FIRSTBLK_VLC_SIZE] = {
   0,  8,  4,  9,  5,  9,  8, 10,  6, 11,  8, 11,  9, 12, 11, 12,
  16, 16, 16, 16, 16, 16, 16, 16,  4, 11,  6, 11,  9, 12, 10, 12,
   9, 13, 10, 13, 11, 16, 12, 13, 16, 16, 16, 16, 16, 16, 16, 16,
@@ -3263,7 +3263,7 @@ static const uint8_t rv40_table_1_3_4[FI
  14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 14, 15,
 };
 
-static const uint8_t rv40_table_1_3_5[2][OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_3_5[2][OTHERBLK_VLC_SIZE] = {
 { 0,  4, 12,  3,  7, 12, 10, 11, 14,  3,  6, 12,  7,  9, 13, 12,
  13, 14,  8, 11, 13, 11, 12, 14, 14, 14, 14,  1,  7, 12,  5,  8,
  13, 10, 12, 14,  4,  8, 13,  8,  9, 13, 12, 13, 14,  9, 11, 14,
@@ -3280,13 +3280,13 @@ static const uint8_t rv40_table_1_3_5[2]
  14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 }
 };
 
-static const uint8_t rv40_table_1_3_6[COEFF_VLC_SIZE] = {
+static const uint8_t rv34_table_1_3_6[COEFF_VLC_SIZE] = {
   1,  2,  3,  4,  5,  6,  8,  8,  9,  9, 10, 10, 11, 11, 12, 12,
  13, 13, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 };
 
 // BLOCK 4
-static const uint8_t rv40_table_1_4_0[CBPPAT_VLC_SIZE] = {
+static const uint8_t rv34_table_1_4_0[CBPPAT_VLC_SIZE] = {
   2,  5,  5,  5,  5,  5,  6,  6,  5,  6,  5,  6,  5,  6,  6,  4,
   6,  8, 10,  8, 10,  9, 11,  9, 10, 10, 10,  9, 10,  9, 10,  8,
  10, 11, 13, 11, 13, 11, 14, 11, 14, 13, 13, 12, 13, 12, 13, 10,
@@ -3370,14 +3370,14 @@ static const uint8_t rv40_table_1_4_0[CB
  12, 14, 14, 14, 14, 15, 16, 14, 14, 16, 15, 14, 14, 15, 14, 11,
 };
 
-static const uint8_t rv40_table_1_4_1[4][CBP_VLC_SIZE] = {
+static const uint8_t rv34_table_1_4_1[4][CBP_VLC_SIZE] = {
  { 0,  5,  5,  3,  5,  3,  5,  4,  5,  5,  3,  4,  3,  4,  4,  4 },
  { 0,  5,  5,  3,  5,  4,  5,  4,  5,  5,  3,  4,  3,  4,  4,  3 },
  { 0,  6,  6,  4,  6,  4,  5,  4,  6,  5,  4,  3,  4,  4,  3,  2 },
  { 0,  7,  7,  4,  7,  5,  6,  4,  7,  6,  5,  4,  4,  4,  4,  1 }
 };
 
-static const uint8_t rv40_table_1_4_2[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_4_2[FIRSTBLK_VLC_SIZE] = {
   0,  7,  3,  7,  4,  7,  6,  7,  6,  9,  7,  9,  7,  9,  8,  9,
  13, 14, 12, 13, 13, 13, 12, 12,  4,  9,  5,  9,  7,  9,  8,  9,
   7, 11,  8, 10,  9, 11,  9, 10, 13, 16, 12, 14, 13, 14, 12, 12,
@@ -3434,7 +3434,7 @@ static const uint8_t rv40_table_1_4_2[FI
  13, 16, 12, 14, 13, 15, 11, 11, 14, 16, 12, 13, 12, 13, 11, 10,
 };
 
-static const uint8_t rv40_table_1_4_3[2][OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_4_3[2][OTHERBLK_VLC_SIZE] = {
 { 0,  4,  9,  3,  6, 10,  7,  9, 11,  3,  5,  9,  5,  7, 10,  9,
  10, 12,  7,  8, 10,  9, 10, 11, 11, 12, 12,  2,  6, 10,  4,  7,
  10,  7,  9, 12,  4,  7, 10,  6,  7, 11,  9, 10, 12,  7,  9, 11,
@@ -3451,7 +3451,7 @@ static const uint8_t rv40_table_1_4_3[2]
  14, 15, 16, 13, 14, 15, 14, 14, 15, 15, 16, 16 }
 };
 
-static const uint8_t rv40_table_1_4_4[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_4_4[FIRSTBLK_VLC_SIZE] = {
   0,  8,  4,  9,  5, 10,  9, 11,  5, 11,  9, 12,  9, 13, 12, 16,
  16, 16, 16, 16, 16, 16, 16, 16,  4, 11,  6, 12,  9, 13, 11, 13,
   9, 16, 10, 16, 12, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16,
@@ -3508,7 +3508,7 @@ static const uint8_t rv40_table_1_4_4[FI
  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 };
 
-static const uint8_t rv40_table_1_4_5[2][OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_4_5[2][OTHERBLK_VLC_SIZE] = {
 { 0,  4, 12,  3,  7, 13, 10, 12, 15,  3,  7, 13,  7,  9, 14, 12,
  12, 13,  8, 11, 14, 11, 13, 15, 15, 14, 14,  1,  6, 13,  5,  8,
  13, 10, 13, 15,  4,  8, 13,  8,  9, 14, 13, 13, 15,  8, 11, 14,
@@ -3525,13 +3525,13 @@ static const uint8_t rv40_table_1_4_5[2]
  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 }
 };
 
-static const uint8_t rv40_table_1_4_6[COEFF_VLC_SIZE] = {
+static const uint8_t rv34_table_1_4_6[COEFF_VLC_SIZE] = {
   1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 13, 14, 15, 16, 16,
  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 };
 
 // BLOCK 5
-static const uint8_t rv40_table_1_5_0[CBPPAT_VLC_SIZE] = {
+static const uint8_t rv34_table_1_5_0[CBPPAT_VLC_SIZE] = {
   1,  5,  5,  6,  5,  6,  7,  7,  5,  7,  6,  7,  5,  6,  6,  6,
   6,  9, 10,  9, 10,  9, 11, 10, 11, 11, 11, 10, 11, 10, 11,  9,
  10, 11, 14, 12, 14, 12, 16, 12, 16, 13, 16, 13, 14, 13, 16, 12,
@@ -3615,14 +3615,14 @@ static const uint8_t rv40_table_1_5_0[CB
  12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13,
 };
 
-static const uint8_t rv40_table_1_5_1[4][CBP_VLC_SIZE] = {
+static const uint8_t rv34_table_1_5_1[4][CBP_VLC_SIZE] = {
  { 0,  5,  5,  3,  5,  3,  5,  4,  5,  5,  3,  4,  3,  4,  4,  4 },
  { 0,  5,  5,  3,  5,  4,  5,  4,  5,  5,  3,  4,  3,  4,  4,  3 },
  { 0,  5,  5,  3,  5,  4,  4,  4,  5,  4,  4,  4,  3,  4,  4,  3 },
  { 0,  6,  6,  4,  6,  4,  5,  4,  6,  5,  4,  3,  4,  4,  3,  2 }
 };
 
-static const uint8_t rv40_table_1_5_2[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_5_2[FIRSTBLK_VLC_SIZE] = {
   0,  7,  4,  8,  4,  8,  7,  8,  6, 10,  7, 10,  8, 10,  9, 10,
  13, 16, 13, 15, 13, 15, 13, 14,  4, 10,  5, 10,  7, 10,  9, 10,
   7, 12,  8, 11,  9, 12, 10, 11, 13, 16, 13, 15, 13, 16, 13, 14,
@@ -3679,7 +3679,7 @@ static const uint8_t rv40_table_1_5_2[FI
  13, 16, 13, 16, 13, 16, 12, 13, 15, 16, 13, 14, 14, 15, 13, 13,
 };
 
-static const uint8_t rv40_table_1_5_3[2][OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_5_3[2][OTHERBLK_VLC_SIZE] = {
 { 0,  5, 10,  3,  7, 11,  9, 11, 14,  3,  7, 11,  7,  8, 12, 11,
  12, 14,  7,  9, 12, 10, 11, 14, 13, 14, 16,  1,  7, 11,  5,  8,
  12,  9, 11, 15,  4,  8, 12,  7,  9, 13, 11, 12, 15,  8, 10, 13,
@@ -3696,7 +3696,7 @@ static const uint8_t rv40_table_1_5_3[2]
  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 }
 };
 
-static const uint8_t rv40_table_1_5_4[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_5_4[FIRSTBLK_VLC_SIZE] = {
   0,  8,  4, 10,  5, 11, 10, 16,  5, 12,  9, 16, 10, 16, 16, 16,
  16, 16, 16, 16, 16, 16, 16, 16,  4, 12,  7, 12,  9, 16, 12, 16,
   9, 16, 11, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
@@ -3753,7 +3753,7 @@ static const uint8_t rv40_table_1_5_4[FI
  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 };
 
-static const uint8_t rv40_table_1_5_5[2][OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_5_5[2][OTHERBLK_VLC_SIZE] = {
 { 0,  5, 16,  3,  8, 14, 11, 13, 14,  2,  8, 14,  8, 10, 16, 13,
  13, 14,  9, 13, 16, 12, 13, 16, 16, 14, 16,  1,  7, 14,  6, 10,
  14, 12, 16, 16,  5,  9, 14,  9, 11, 16, 15, 16, 16, 10, 12, 16,
@@ -3770,13 +3770,13 @@ static const uint8_t rv40_table_1_5_5[2]
  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 }
 };
 
-static const uint8_t rv40_table_1_5_6[COEFF_VLC_SIZE] = {
+static const uint8_t rv34_table_1_5_6[COEFF_VLC_SIZE] = {
   1,  2,  3,  4,  5,  6,  7,  8, 10, 10, 11, 11, 13, 12, 12, 13,
  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 };
 
 // BLOCK 6
-static const uint8_t rv40_table_1_6_0[CBPPAT_VLC_SIZE] = {
+static const uint8_t rv34_table_1_6_0[CBPPAT_VLC_SIZE] = {
   1,  5,  5,  6,  5,  6,  7,  8,  5,  7,  6,  8,  6,  7,  7,  7,
   5,  9, 10, 10, 10, 10, 12, 11, 10, 11, 11, 11, 10, 11, 12, 10,
   9, 11, 13, 12, 13, 12, 16, 14, 16, 14, 16, 16, 16, 13, 16, 13,
@@ -3860,14 +3860,14 @@ static const uint8_t rv40_table_1_6_0[CB
  10, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 14,
 };
 
-static const uint8_t rv40_table_1_6_1[4][CBP_VLC_SIZE] = {
+static const uint8_t rv34_table_1_6_1[4][CBP_VLC_SIZE] = {
  { 0,  4,  4,  3,  4,  3,  5,  5,  4,  5,  3,  5,  3,  5,  4,  5 },
  { 0,  4,  4,  3,  4,  4,  5,  4,  4,  5,  3,  5,  3,  5,  4,  4 },
  { 0,  4,  4,  3,  4,  4,  5,  4,  4,  5,  4,  4,  3,  4,  4,  4 },
  { 0,  4,  4,  3,  5,  4,  5,  4,  5,  5,  4,  4,  3,  4,  4,  3 }
 };
 
-static const uint8_t rv40_table_1_6_2[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_6_2[FIRSTBLK_VLC_SIZE] = {
   0,  8,  4, 10,  5,  9,  8, 10,  6, 11,  8, 12,  8, 11, 10, 13,
  14, 16, 14, 16, 14, 16, 16, 16,  3, 11,  5, 11,  8, 12, 10, 12,
   7, 12,  9, 13, 10, 13, 11, 13, 14, 16, 14, 16, 16, 16, 16, 16,
@@ -3924,7 +3924,7 @@ static const uint8_t rv40_table_1_6_2[FI
  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 };
 
-static const uint8_t rv40_table_1_6_3[2][OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_6_3[2][OTHERBLK_VLC_SIZE] = {
 { 0,  5, 11,  3,  7, 13,  9, 12, 16,  3,  7, 12,  6,  9, 14, 11,
  13, 16,  7, 10, 16, 11, 12, 16, 16, 16, 16,  1,  6, 12,  5,  9,
  16,  9, 13, 16,  4,  8, 16,  7, 10, 16, 12, 15, 16,  7, 11, 16,
@@ -3941,7 +3941,7 @@ static const uint8_t rv40_table_1_6_3[2]
  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 }
 };
 
-static const uint8_t rv40_table_1_6_4[FIRSTBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_6_4[FIRSTBLK_VLC_SIZE] = {
   0, 10,  4, 12,  5, 16, 11, 16,  6, 16, 10, 16, 11, 16, 16, 16,
  16, 16, 16, 16, 16, 16, 16, 16,  3, 16,  7, 16, 10, 16, 16, 16,
   9, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
@@ -3998,7 +3998,7 @@ static const uint8_t rv40_table_1_6_4[FI
  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 };
 
-static const uint8_t rv40_table_1_6_5[2][OTHERBLK_VLC_SIZE] = {
+static const uint8_t rv34_table_1_6_5[2][OTHERBLK_VLC_SIZE] = {
 { 0,  5, 16,  3,  8, 16, 12, 12, 16,  2,  8, 16,  8, 10, 16, 13,
  13, 16,  9, 13, 16, 12, 13, 16, 16, 16, 16,  1,  8, 16,  6, 10,
  16, 12, 16, 16,  5,  9, 16,  9, 11, 16, 13, 16, 16,  9, 12, 14,
@@ -4015,108 +4015,108 @@ static const uint8_t rv40_table_1_6_5[2]
  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 }
 };
 
-static const uint8_t rv40_table_1_6_6[COEFF_VLC_SIZE] = {
+static const uint8_t rv34_table_1_6_6[COEFF_VLC_SIZE] = {
   1,  2,  3,  4,  5,  6,  7,  8, 10, 10, 10, 11, 14, 13, 15, 16,
  16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16,
 };
 
 
-static const uint8_t* rv40_intra_cbppatvlc_pointers[NUM_INTRA_TABLES][2] = {
- { rv40_table_0_0_0, rv40_table_0_0_2 }, { rv40_table_0_1_0, rv40_table_0_1_2 },
- { rv40_table_0_2_0, rv40_table_0_2_2 }, { rv40_table_0_3_0, rv40_table_0_3_2 },
- { rv40_table_0_4_0, rv40_table_0_4_2 },
+static const uint8_t* rv34_intra_cbppatvlc_pointers[NUM_INTRA_TABLES][2] = {
+ { rv34_table_0_0_0, rv34_table_0_0_2 }, { rv34_table_0_1_0, rv34_table_0_1_2 },
+ { rv34_table_0_2_0, rv34_table_0_2_2 }, { rv34_table_0_3_0, rv34_table_0_3_2 },
+ { rv34_table_0_4_0, rv34_table_0_4_2 },
 };
 
-static const uint8_t* rv40_intra_cbpvlc_pointers[NUM_INTRA_TABLES][2][4] = {
- {{ rv40_table_0_0_1[0], rv40_table_0_0_1[1], rv40_table_0_0_1[2], rv40_table_0_0_1[3]},
-  { rv40_table_0_0_3[0], rv40_table_0_0_3[1], rv40_table_0_0_3[2], rv40_table_0_0_3[3]} },
- {{ rv40_table_0_1_1[0], rv40_table_0_1_1[1], rv40_table_0_1_1[2], rv40_table_0_1_1[3]},
-  { rv40_table_0_1_3[0], rv40_table_0_1_3[1], rv40_table_0_1_3[2], rv40_table_0_1_3[3]} },
- {{ rv40_table_0_2_1[0], rv40_table_0_2_1[1], rv40_table_0_2_1[2], rv40_table_0_2_1[3]},
-  { rv40_table_0_2_3[0], rv40_table_0_2_3[1], rv40_table_0_2_3[2], rv40_table_0_2_3[3]} },
- {{ rv40_table_0_3_1[0], rv40_table_0_3_1[1], rv40_table_0_3_1[2], rv40_table_0_3_1[3]},
-  { rv40_table_0_3_3[0], rv40_table_0_3_3[1], rv40_table_0_3_3[2], rv40_table_0_3_3[3]} },
- {{ rv40_table_0_4_1[0], rv40_table_0_4_1[1], rv40_table_0_4_1[2], rv40_table_0_4_1[3]},
-  { rv40_table_0_4_3[0], rv40_table_0_4_3[1], rv40_table_0_4_3[2], rv40_table_0_4_3[3]} },
+static const uint8_t* rv34_intra_cbpvlc_pointers[NUM_INTRA_TABLES][2][4] = {
+ {{ rv34_table_0_0_1[0], rv34_table_0_0_1[1], rv34_table_0_0_1[2], rv34_table_0_0_1[3]},
+  { rv34_table_0_0_3[0], rv34_table_0_0_3[1], rv34_table_0_0_3[2], rv34_table_0_0_3[3]} },
+ {{ rv34_table_0_1_1[0], rv34_table_0_1_1[1], rv34_table_0_1_1[2], rv34_table_0_1_1[3]},
+  { rv34_table_0_1_3[0], rv34_table_0_1_3[1], rv34_table_0_1_3[2], rv34_table_0_1_3[3]} },
+ {{ rv34_table_0_2_1[0], rv34_table_0_2_1[1], rv34_table_0_2_1[2], rv34_table_0_2_1[3]},
+  { rv34_table_0_2_3[0], rv34_table_0_2_3[1], rv34_table_0_2_3[2], rv34_table_0_2_3[3]} },
+ {{ rv34_table_0_3_1[0], rv34_table_0_3_1[1], rv34_table_0_3_1[2], rv34_table_0_3_1[3]},
+  { rv34_table_0_3_3[0], rv34_table_0_3_3[1], rv34_table_0_3_3[2], rv34_table_0_3_3[3]} },
+ {{ rv34_table_0_4_1[0], rv34_table_0_4_1[1], rv34_table_0_4_1[2], rv34_table_0_4_1[3]},
+  { rv34_table_0_4_3[0], rv34_table_0_4_3[1], rv34_table_0_4_3[2], rv34_table_0_4_3[3]} },
 };
 
-static const uint8_t* rv40_intra_firstpatvlc_pointers[NUM_INTRA_TABLES][4] = {
- { rv40_table_0_0_9, rv40_table_0_0_4, rv40_table_0_0_5, rv40_table_0_0_6 },
- { rv40_table_0_1_9, rv40_table_0_1_4, rv40_table_0_1_5, rv40_table_0_1_6 },
- { rv40_table_0_2_9, rv40_table_0_2_4, rv40_table_0_2_5, rv40_table_0_2_6 },
- { rv40_table_0_3_9, rv40_table_0_3_4, rv40_table_0_3_5, rv40_table_0_3_6 },
- { rv40_table_0_4_9, rv40_table_0_4_4, rv40_table_0_4_5, rv40_table_0_4_6 },
+static const uint8_t* rv34_intra_firstpatvlc_pointers[NUM_INTRA_TABLES][4] = {
+ { rv34_table_0_0_9, rv34_table_0_0_4, rv34_table_0_0_5, rv34_table_0_0_6 },
+ { rv34_table_0_1_9, rv34_table_0_1_4, rv34_table_0_1_5, rv34_table_0_1_6 },
+ { rv34_table_0_2_9, rv34_table_0_2_4, rv34_table_0_2_5, rv34_table_0_2_6 },
+ { rv34_table_0_3_9, rv34_table_0_3_4, rv34_table_0_3_5, rv34_table_0_3_6 },
+ { rv34_table_0_4_9, rv34_table_0_4_4, rv34_table_0_4_5, rv34_table_0_4_6 },
 };
 
-static const uint8_t* rv40_intra_secondpatvlc_pointers[NUM_INTRA_TABLES][2] = {
- { rv40_table_0_0_7, rv40_table_0_0_10[0] },
- { rv40_table_0_1_7, rv40_table_0_1_10[0] },
- { rv40_table_0_2_7, rv40_table_0_2_10[0] },
- { rv40_table_0_3_7, rv40_table_0_3_10[0] },
- { rv40_table_0_4_7, rv40_table_0_4_10[0] },
+static const uint8_t* rv34_intra_secondpatvlc_pointers[NUM_INTRA_TABLES][2] = {
+ { rv34_table_0_0_7, rv34_table_0_0_10[0] },
+ { rv34_table_0_1_7, rv34_table_0_1_10[0] },
+ { rv34_table_0_2_7, rv34_table_0_2_10[0] },
+ { rv34_table_0_3_7, rv34_table_0_3_10[0] },
+ { rv34_table_0_4_7, rv34_table_0_4_10[0] },
 };
 
-static const uint8_t* rv40_intra_thirdpatvlc_pointers[NUM_INTRA_TABLES][2] = {
- { rv40_table_0_0_8, rv40_table_0_0_10[1] },
- { rv40_table_0_1_8, rv40_table_0_1_10[1] },
- { rv40_table_0_2_8, rv40_table_0_2_10[1] },
- { rv40_table_0_3_8, rv40_table_0_3_10[1] },
- { rv40_table_0_4_8, rv40_table_0_4_10[1] },
+static const uint8_t* rv34_intra_thirdpatvlc_pointers[NUM_INTRA_TABLES][2] = {
+ { rv34_table_0_0_8, rv34_table_0_0_10[1] },
+ { rv34_table_0_1_8, rv34_table_0_1_10[1] },
+ { rv34_table_0_2_8, rv34_table_0_2_10[1] },
+ { rv34_table_0_3_8, rv34_table_0_3_10[1] },
+ { rv34_table_0_4_8, rv34_table_0_4_10[1] },
 };
 
-static const uint8_t* rv40_intra_coeffvlc_pointers[NUM_INTRA_TABLES] = {
- rv40_table_0_0_11, rv40_table_0_1_11, rv40_table_0_2_11, rv40_table_0_3_11, rv40_table_0_4_11
+static const uint8_t* rv34_intra_coeffvlc_pointers[NUM_INTRA_TABLES] = {
+ rv34_table_0_0_11, rv34_table_0_1_11, rv34_table_0_2_11, rv34_table_0_3_11, rv34_table_0_4_11
 };
 
 
-static const uint8_t* rv40_inter_cbppatvlc_pointers[NUM_INTER_TABLES] = {
- rv40_table_1_0_0, rv40_table_1_1_0, rv40_table_1_2_0, rv40_table_1_3_0,
- rv40_table_1_4_0, rv40_table_1_5_0, rv40_table_1_6_0,
+static const uint8_t* rv34_inter_cbppatvlc_pointers[NUM_INTER_TABLES] = {
+ rv34_table_1_0_0, rv34_table_1_1_0, rv34_table_1_2_0, rv34_table_1_3_0,
+ rv34_table_1_4_0, rv34_table_1_5_0, rv34_table_1_6_0,
 };
 
-static const uint8_t* rv40_inter_cbpvlc_pointers[NUM_INTER_TABLES][4] = {
- { rv40_table_1_0_1[0], rv40_table_1_0_1[1], rv40_table_1_0_1[2], rv40_table_1_0_1[3] },
- { rv40_table_1_1_1[0], rv40_table_1_1_1[1], rv40_table_1_1_1[2], rv40_table_1_1_1[3] },
- { rv40_table_1_2_1[0], rv40_table_1_2_1[1], rv40_table_1_2_1[2], rv40_table_1_2_1[3] },
- { rv40_table_1_3_1[0], rv40_table_1_3_1[1], rv40_table_1_3_1[2], rv40_table_1_3_1[3] },
- { rv40_table_1_4_1[0], rv40_table_1_4_1[1], rv40_table_1_4_1[2], rv40_table_1_4_1[3] },
- { rv40_table_1_5_1[0], rv40_table_1_5_1[1], rv40_table_1_5_1[2], rv40_table_1_5_1[3] },
- { rv40_table_1_6_1[0], rv40_table_1_6_1[1], rv40_table_1_6_1[2], rv40_table_1_6_1[3] },
+static const uint8_t* rv34_inter_cbpvlc_pointers[NUM_INTER_TABLES][4] = {
+ { rv34_table_1_0_1[0], rv34_table_1_0_1[1], rv34_table_1_0_1[2], rv34_table_1_0_1[3] },
+ { rv34_table_1_1_1[0], rv34_table_1_1_1[1], rv34_table_1_1_1[2], rv34_table_1_1_1[3] },
+ { rv34_table_1_2_1[0], rv34_table_1_2_1[1], rv34_table_1_2_1[2], rv34_table_1_2_1[3] },
+ { rv34_table_1_3_1[0], rv34_table_1_3_1[1], rv34_table_1_3_1[2], rv34_table_1_3_1[3] },
+ { rv34_table_1_4_1[0], rv34_table_1_4_1[1], rv34_table_1_4_1[2], rv34_table_1_4_1[3] },
+ { rv34_table_1_5_1[0], rv34_table_1_5_1[1], rv34_table_1_5_1[2], rv34_table_1_5_1[3] },
+ { rv34_table_1_6_1[0], rv34_table_1_6_1[1], rv34_table_1_6_1[2], rv34_table_1_6_1[3] },
 };
 
-static const uint8_t* rv40_inter_firstpatvlc_pointers[NUM_INTER_TABLES][2] = {
- { rv40_table_1_0_2, rv40_table_1_0_4 },
- { rv40_table_1_1_2, rv40_table_1_1_4 },
- { rv40_table_1_2_2, rv40_table_1_2_4 },
- { rv40_table_1_3_2, rv40_table_1_3_4 },
- { rv40_table_1_4_2, rv40_table_1_4_4 },
- { rv40_table_1_5_2, rv40_table_1_5_4 },
- { rv40_table_1_6_2, rv40_table_1_6_4 }
+static const uint8_t* rv34_inter_firstpatvlc_pointers[NUM_INTER_TABLES][2] = {
+ { rv34_table_1_0_2, rv34_table_1_0_4 },
+ { rv34_table_1_1_2, rv34_table_1_1_4 },
+ { rv34_table_1_2_2, rv34_table_1_2_4 },
+ { rv34_table_1_3_2, rv34_table_1_3_4 },
+ { rv34_table_1_4_2, rv34_table_1_4_4 },
+ { rv34_table_1_5_2, rv34_table_1_5_4 },
+ { rv34_table_1_6_2, rv34_table_1_6_4 }
 };
 
-static const uint8_t* rv40_inter_secondpatvlc_pointers[NUM_INTER_TABLES][2] = {
- { rv40_table_1_0_3[0], rv40_table_1_0_5[0] },
- { rv40_table_1_1_3[0], rv40_table_1_1_5[0] },
- { rv40_table_1_2_3[0], rv40_table_1_2_5[0] },
- { rv40_table_1_3_3[0], rv40_table_1_3_5[0] },
- { rv40_table_1_4_3[0], rv40_table_1_4_5[0] },
- { rv40_table_1_5_3[0], rv40_table_1_5_5[0] },
- { rv40_table_1_6_3[0], rv40_table_1_6_5[0] },
+static const uint8_t* rv34_inter_secondpatvlc_pointers[NUM_INTER_TABLES][2] = {
+ { rv34_table_1_0_3[0], rv34_table_1_0_5[0] },
+ { rv34_table_1_1_3[0], rv34_table_1_1_5[0] },
+ { rv34_table_1_2_3[0], rv34_table_1_2_5[0] },
+ { rv34_table_1_3_3[0], rv34_table_1_3_5[0] },
+ { rv34_table_1_4_3[0], rv34_table_1_4_5[0] },
+ { rv34_table_1_5_3[0], rv34_table_1_5_5[0] },
+ { rv34_table_1_6_3[0], rv34_table_1_6_5[0] },
 };
 
-static const uint8_t* rv40_inter_thirdpatvlc_pointers[NUM_INTER_TABLES][2] = {
- { rv40_table_1_0_3[1], rv40_table_1_0_5[1] },
- { rv40_table_1_1_3[1], rv40_table_1_1_5[1] },
- { rv40_table_1_2_3[1], rv40_table_1_2_5[1] },
- { rv40_table_1_3_3[1], rv40_table_1_3_5[1] },
- { rv40_table_1_4_3[1], rv40_table_1_4_5[1] },
- { rv40_table_1_5_3[1], rv40_table_1_5_5[1] },
- { rv40_table_1_6_3[1], rv40_table_1_6_5[1] },
+static const uint8_t* rv34_inter_thirdpatvlc_pointers[NUM_INTER_TABLES][2] = {
+ { rv34_table_1_0_3[1], rv34_table_1_0_5[1] },
+ { rv34_table_1_1_3[1], rv34_table_1_1_5[1] },
+ { rv34_table_1_2_3[1], rv34_table_1_2_5[1] },
+ { rv34_table_1_3_3[1], rv34_table_1_3_5[1] },
+ { rv34_table_1_4_3[1], rv34_table_1_4_5[1] },
+ { rv34_table_1_5_3[1], rv34_table_1_5_5[1] },
+ { rv34_table_1_6_3[1], rv34_table_1_6_5[1] },
 };
 
-static const uint8_t* rv40_inter_coeffvlc_pointers[NUM_INTER_TABLES] = {
- rv40_table_1_0_6, rv40_table_1_1_6, rv40_table_1_2_6, rv40_table_1_3_6,
- rv40_table_1_4_6, rv40_table_1_5_6, rv40_table_1_6_6,
+static const uint8_t* rv34_inter_coeffvlc_pointers[NUM_INTER_TABLES] = {
+ rv34_table_1_0_6, rv34_table_1_1_6, rv34_table_1_2_6, rv34_table_1_3_6,
+ rv34_table_1_4_6, rv34_table_1_5_6, rv34_table_1_6_6,
 };
 
 #endif /* RV40VLC_H */



More information about the FFmpeg-soc mailing list