]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/rpza.c
Ministry of English Composition, reporting for duty (and the word is "skipped", not...
[ffmpeg] / libavcodec / rpza.c
index 965fb729b067013e6802669c4fb116cf93fab188..6b1510a4bf9dba0ab3b03c62053e518fbd728e0e 100644 (file)
@@ -53,12 +53,6 @@ typedef struct RpzaContext {
 
 } RpzaContext;
 
-#define BE_16(x)  ((((uint8_t*)(x))[0] << 8) | ((uint8_t*)(x))[1])
-#define BE_32(x)  ((((uint8_t*)(x))[0] << 24) | \
-                   (((uint8_t*)(x))[1] << 16) | \
-                   (((uint8_t*)(x))[2] << 8) | \
-                    ((uint8_t*)(x))[3])
-
 #define ADVANCE_BLOCK() \
 { \
     pixel_ptr += 4; \
@@ -98,7 +92,7 @@ static void rpza_decode_stream(RpzaContext *s)
 
     /* First byte is always 0xe1. Warn if it's different */
     if (s->buf[stream_ptr] != 0xe1)
-        av_log(s->avctx, AV_LOG_ERROR, "First chunk byte is 0x%02x instead of 0x1e\n",
+        av_log(s->avctx, AV_LOG_ERROR, "First chunk byte is 0x%02x instead of 0xe1\n",
             s->buf[stream_ptr]);
 
     /* Get chunk size, ingnoring first byte */
@@ -112,7 +106,7 @@ static void rpza_decode_stream(RpzaContext *s)
     chunk_size = s->size;
 
     /* Number of 4x4 blocks in frame. */
-    total_blocks = (s->avctx->width * s->avctx->height) / (4 * 4);
+    total_blocks = ((s->avctx->width + 3) / 4) * ((s->avctx->height + 3) / 4);
 
     /* Process chunk data */
     while (stream_ptr < chunk_size) {
@@ -254,10 +248,6 @@ static int rpza_decode_frame(AVCodecContext *avctx,
 {
     RpzaContext *s = (RpzaContext *)avctx->priv_data;
 
-    /* no supplementary picture */
-    if (buf_size == 0)
-        return 0;
-
     s->buf = buf;
     s->size = buf_size;