aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/rpza.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-02-10 20:45:40 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-02-10 20:46:03 +0100
commit996fdca8fbc10074e3b55cfa5c9eb346d324c29d (patch)
tree480b039d47efe9d1e7d8738a4068a96fcc61b78a /libavcodec/rpza.c
parent0a4311dee55b3ac56282505f3f6fbbb63b8a7be1 (diff)
parenta46dc49744bdc4f2e31725b63ac8e41f701e4fa1 (diff)
downloadffmpeg-996fdca8fbc10074e3b55cfa5c9eb346d324c29d.tar.gz
Merge commit 'a46dc49744bdc4f2e31725b63ac8e41f701e4fa1'
* commit 'a46dc49744bdc4f2e31725b63ac8e41f701e4fa1': rpza: move some variables to the blocks where they are used Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/rpza.c')
-rw-r--r--libavcodec/rpza.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/libavcodec/rpza.c b/libavcodec/rpza.c
index bc240fdcdd..47de9ccce1 100644
--- a/libavcodec/rpza.c
+++ b/libavcodec/rpza.c
@@ -74,11 +74,8 @@ static void rpza_decode_stream(RpzaContext *s)
int stride = s->frame->linesize[0] / 2;
int row_inc = stride - 4;
int chunk_size;
- uint8_t opcode;
- int n_blocks;
uint16_t colorA = 0, colorB;
uint16_t color4[4];
- uint8_t index, idx;
uint16_t ta, tb;
uint16_t *pixels = (uint16_t *)s->frame->data[0];
@@ -105,9 +102,9 @@ static void rpza_decode_stream(RpzaContext *s)
/* Process chunk data */
while (bytestream2_get_bytes_left(&s->gb)) {
- opcode = bytestream2_get_byte(&s->gb); /* Get opcode */
+ uint8_t opcode = bytestream2_get_byte(&s->gb); /* Get opcode */
- n_blocks = (opcode & 0x1f) + 1; /* Extract block counter from opcode */
+ int n_blocks = (opcode & 0x1f) + 1; /* Extract block counter from opcode */
/* If opcode MSbit is 0, we need more data to decide what to do */
if ((opcode & 0x80) == 0) {
@@ -183,9 +180,9 @@ static void rpza_decode_stream(RpzaContext *s)
ADVANCE_BLOCK();
block_ptr = row_ptr + pixel_ptr;
for (pixel_y = 0; pixel_y < 4; pixel_y++) {
- index = bytestream2_get_byteu(&s->gb);
+ uint8_t index = bytestream2_get_byteu(&s->gb);
for (pixel_x = 0; pixel_x < 4; pixel_x++){
- idx = (index >> (2 * (3 - pixel_x))) & 0x03;
+ uint8_t idx = (index >> (2 * (3 - pixel_x))) & 0x03;
pixels[block_ptr] = color4[idx];
block_ptr++;
}