]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/rv30.c
Move arch check before OS check.
[ffmpeg] / libavcodec / rv30.c
index 81a11e8ada2d734ad15c9980cb310dac1e97a91d..e871b534e5ad1f6227b8f7a26f9af79f5655fd0d 100644 (file)
@@ -27,6 +27,7 @@
 #include "avcodec.h"
 #include "dsputil.h"
 #include "mpegvideo.h"
+#include "golomb.h"
 
 #include "rv34.h"
 #include "rv30data.h"
@@ -46,7 +47,7 @@ static int rv30_parse_slice_header(RV34DecContext *r, GetBitContext *gb, SliceIn
         return -1;
     si->quant = get_bits(gb, 5);
     skip_bits1(gb);
-    skip_bits(gb, 13); // timestamp
+    si->pts = get_bits(gb, 13);
     skip_bits(gb, r->rpr);
     si->width  = w;
     si->height = h;
@@ -60,13 +61,13 @@ static int rv30_parse_slice_header(RV34DecContext *r, GetBitContext *gb, SliceIn
 /**
  * Decode 4x4 intra types array.
  */
-static int rv30_decode_intra_types(RV34DecContext *r, GetBitContext *gb, int *dst)
+static int rv30_decode_intra_types(RV34DecContext *r, GetBitContext *gb, int8_t *dst)
 {
     int i, j, k;
 
     for(i = 0; i < 4; i++, dst += r->s.b4_stride - 4){
         for(j = 0; j < 4; j+= 2){
-            int code = (ff_rv34_get_gamma(gb) - 1) << 1;
+            int code = svq3_get_ue_golomb(gb) << 1;
             if(code >= 81*2){
                 av_log(r->s.avctx, AV_LOG_ERROR, "Incorrect intra prediction code\n");
                 return -1;
@@ -94,7 +95,7 @@ static int rv30_decode_mb_info(RV34DecContext *r)
     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 };
     MpegEncContext *s = &r->s;
     GetBitContext *gb = &s->gb;
-    int code = ff_rv34_get_gamma(gb) - 1;
+    int code = svq3_get_ue_golomb(gb);
 
     if(code > 11){
         av_log(s->avctx, AV_LOG_ERROR, "Incorrect MB type code\n");
@@ -104,7 +105,7 @@ static int rv30_decode_mb_info(RV34DecContext *r)
         av_log(s->avctx, AV_LOG_ERROR, "dquant needed\n");
         code -= 6;
     }
-    if(s->pict_type != B_TYPE)
+    if(s->pict_type != FF_B_TYPE)
         return rv30_p_types[code];
     else
         return rv30_b_types[code];
@@ -113,7 +114,7 @@ static int rv30_decode_mb_info(RV34DecContext *r)
 /**
  * Initialize decoder.
  */
-static int rv30_decode_init(AVCodecContext *avctx)
+static av_cold int rv30_decode_init(AVCodecContext *avctx)
 {
     RV34DecContext *r = avctx->priv_data;
 
@@ -143,4 +144,5 @@ AVCodec rv30_decoder = {
     ff_rv34_decode_end,
     ff_rv34_decode_frame,
     CODEC_CAP_DR1 | CODEC_CAP_DELAY,
+    .long_name = "RealVideo 3.0",
 };