Mercurial > libavcodec.hg
comparison rv30.c @ 5995:a33699306850 libavcodec
Use existing function for VLC reading
author | kostya |
---|---|
date | Fri, 07 Dec 2007 05:56:07 +0000 |
parents | 5dfff8f6f524 |
children | 493dc59d469a |
comparison
equal
deleted
inserted
replaced
5994:625b4a680d41 | 5995:a33699306850 |
---|---|
25 */ | 25 */ |
26 | 26 |
27 #include "avcodec.h" | 27 #include "avcodec.h" |
28 #include "dsputil.h" | 28 #include "dsputil.h" |
29 #include "mpegvideo.h" | 29 #include "mpegvideo.h" |
30 #include "golomb.h" | |
30 | 31 |
31 #include "rv34.h" | 32 #include "rv34.h" |
32 #include "rv30data.h" | 33 #include "rv30data.h" |
33 | 34 |
34 | 35 |
64 { | 65 { |
65 int i, j, k; | 66 int i, j, k; |
66 | 67 |
67 for(i = 0; i < 4; i++, dst += r->s.b4_stride - 4){ | 68 for(i = 0; i < 4; i++, dst += r->s.b4_stride - 4){ |
68 for(j = 0; j < 4; j+= 2){ | 69 for(j = 0; j < 4; j+= 2){ |
69 int code = (ff_rv34_get_gamma(gb) - 1) << 1; | 70 int code = svq3_get_ue_golomb(gb) << 1; |
70 if(code >= 81*2){ | 71 if(code >= 81*2){ |
71 av_log(r->s.avctx, AV_LOG_ERROR, "Incorrect intra prediction code\n"); | 72 av_log(r->s.avctx, AV_LOG_ERROR, "Incorrect intra prediction code\n"); |
72 return -1; | 73 return -1; |
73 } | 74 } |
74 for(k = 0; k < 2; k++){ | 75 for(k = 0; k < 2; k++){ |
92 { | 93 { |
93 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 }; | 94 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 }; |
94 static const int rv30_b_types[6] = { RV34_MB_SKIP, RV34_MB_B_DIRECT, RV34_MB_B_FORWARD, RV34_MB_B_BACKWARD, RV34_MB_TYPE_INTRA, RV34_MB_TYPE_INTRA16x16 }; | 95 static const int rv30_b_types[6] = { RV34_MB_SKIP, RV34_MB_B_DIRECT, RV34_MB_B_FORWARD, RV34_MB_B_BACKWARD, RV34_MB_TYPE_INTRA, RV34_MB_TYPE_INTRA16x16 }; |
95 MpegEncContext *s = &r->s; | 96 MpegEncContext *s = &r->s; |
96 GetBitContext *gb = &s->gb; | 97 GetBitContext *gb = &s->gb; |
97 int code = ff_rv34_get_gamma(gb) - 1; | 98 int code = svq3_get_ue_golomb(gb); |
98 | 99 |
99 if(code > 11){ | 100 if(code > 11){ |
100 av_log(s->avctx, AV_LOG_ERROR, "Incorrect MB type code\n"); | 101 av_log(s->avctx, AV_LOG_ERROR, "Incorrect MB type code\n"); |
101 return -1; | 102 return -1; |
102 } | 103 } |