aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2008-03-09 09:03:23 +0000
committerKostya Shishkov <kostya.shishkov@gmail.com>2008-03-09 09:03:23 +0000
commit6a02cb8239f5796c8018df0a0af2a331c86440a9 (patch)
tree2010f8bc17b5ddf0b0ba5c7052b1edca1e79fd4a /libavcodec
parentd98878f423606c0175c8ef2dbfe7df309c5e3246 (diff)
downloadffmpeg-6a02cb8239f5796c8018df0a0af2a331c86440a9.tar.gz
Add step variable (for future v5 decoding)
Originally committed as revision 12392 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/fraps.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/fraps.c b/libavcodec/fraps.c
index e70d0aa021..25fccd588e 100644
--- a/libavcodec/fraps.c
+++ b/libavcodec/fraps.c
@@ -84,7 +84,8 @@ static int huff_cmp(const void *va, const void *vb){
* decode Fraps v2 packed plane
*/
static int fraps2_decode_plane(FrapsContext *s, uint8_t *dst, int stride, int w,
- int h, const uint8_t *src, int size, int Uoff)
+ int h, const uint8_t *src, int size, int Uoff,
+ const int step)
{
int i, j;
GetBitContext gb;
@@ -104,7 +105,7 @@ static int fraps2_decode_plane(FrapsContext *s, uint8_t *dst, int stride, int w,
init_get_bits(&gb, s->tmpbuf, size * 8);
for(j = 0; j < h; j++){
- for(i = 0; i < w; i++){
+ for(i = 0; i < w*step; i += step){
dst[i] = get_vlc2(&gb, vlc.table, 9, 3);
/* lines are stored as deltas between previous lines
* and we need to add 0x80 to the first lines of chroma planes
@@ -281,7 +282,7 @@ static int decode_frame(AVCodecContext *avctx,
is_chroma = !!i;
s->tmpbuf = av_realloc(s->tmpbuf, offs[i + 1] - offs[i] - 1024 + FF_INPUT_BUFFER_PADDING_SIZE);
if(fraps2_decode_plane(s, f->data[i], f->linesize[i], avctx->width >> is_chroma,
- avctx->height >> is_chroma, buf + offs[i], offs[i + 1] - offs[i], is_chroma) < 0) {
+ avctx->height >> is_chroma, buf + offs[i], offs[i + 1] - offs[i], is_chroma, 1) < 0) {
av_log(avctx, AV_LOG_ERROR, "Error decoding plane %i\n", i);
return -1;
}