diff options
author | Daniel Verkamp <daniel@drv.nu> | 2012-09-07 19:43:56 -0700 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-09-08 05:36:34 +0200 |
commit | 124f0b2f4687ee8a0d30f0c615e155e72df1df0d (patch) | |
tree | 772e95982f31735aa7611604d37329646f268306 /libavcodec/flashsv2enc.c | |
parent | 5710dbf88cd56e7fbee7ad70240f92fe82ce6566 (diff) | |
download | ffmpeg-124f0b2f4687ee8a0d30f0c615e155e72df1df0d.tar.gz |
flashsv2enc: only encode diff blocks when needed
A flashsv2 block may have a "diff block" to indicate which scan lines of
the block are actually encoded. However, this diff block need not be
used when the entire block is coded.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/flashsv2enc.c')
-rw-r--r-- | libavcodec/flashsv2enc.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/flashsv2enc.c b/libavcodec/flashsv2enc.c index 9725f29206..a33c9bb6f6 100644 --- a/libavcodec/flashsv2enc.c +++ b/libavcodec/flashsv2enc.c @@ -634,18 +634,17 @@ static int encode_all_blocks(FlashSV2Context * s, int keyframe) for (col = 0; col < s->cols; col++) { b = s->frame_blocks + (row * s->cols + col); prev = s->key_blocks + (row * s->cols + col); + b->flags = s->use15_7 ? COLORSPACE_15_7 : 0; if (keyframe) { b->start = 0; b->len = b->height; - b->flags = s->use15_7 ? COLORSPACE_15_7 : 0; } else if (!b->dirty) { b->start = 0; b->len = 0; b->data_size = 0; - b->flags = s->use15_7 ? COLORSPACE_15_7 : 0; continue; - } else { - b->flags = s->use15_7 ? COLORSPACE_15_7 | HAS_DIFF_BLOCKS : HAS_DIFF_BLOCKS; + } else if (b->start != 0 || b->len != b->height) { + b->flags |= HAS_DIFF_BLOCKS; } data = s->current_frame + s->image_width * 3 * s->block_height * row + s->block_width * col * 3; res = encode_block(s, &s->palette, b, prev, data, s->image_width * 3, s->comp, s->dist, keyframe); |