summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2011-07-15 15:28:18 +0200
committerDiego Biurrun <diego@biurrun.de>2011-07-16 00:26:19 +0200
commit12e9bf3e845bd444223e1f326edaabd36236362f (patch)
tree14544b11c2b60831384cbf8306229c77154a9d35
parentb88523c25da37fb45b2df720218f5868b8e891fc (diff)
downloadffmpeg-streaming-12e9bf3e845bd444223e1f326edaabd36236362f.zip
ffmpeg-streaming-12e9bf3e845bd444223e1f326edaabd36236362f.tar.gz
flashsvenc: merge variable declarations and initializations
-rw-r--r--libavcodec/flashsvenc.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/libavcodec/flashsvenc.c b/libavcodec/flashsvenc.c
index 5d04549..ec70b72 100644
--- a/libavcodec/flashsvenc.c
+++ b/libavcodec/flashsvenc.c
@@ -164,9 +164,7 @@ static int encode_bitstream(FlashSVContext *s, AVFrame *p, uint8_t *buf,
int wp = i * block_width; // vertical position in frame
int ws = (i < h_blocks) ? block_width : h_part; // size of block
int ret = Z_OK;
- uint8_t *ptr;
-
- ptr = buf + buf_pos;
+ uint8_t *ptr = buf + buf_pos;
/* copy the block to the temp buffer before compression
* (if it differs from the previous frame's block) */
@@ -175,11 +173,9 @@ static int encode_bitstream(FlashSVContext *s, AVFrame *p, uint8_t *buf,
wp, hs, ws, p->linesize[0], previous_frame);
if (res || *I_frame) {
- unsigned long zsize;
- zsize = 3 * block_width * block_height;
+ unsigned long zsize = 3 * block_width * block_height;
ret = compress2(ptr + 2, &zsize, s->tmpblock, 3 * ws * hs, 9);
-
//ret = deflateReset(&s->zstream);
if (ret != Z_OK)
av_log(s->avctx, AV_LOG_ERROR,
@@ -214,7 +210,7 @@ static int flashsv_encode_frame(AVCodecContext *avctx, uint8_t *buf,
uint8_t *pfptr;
int res;
int I_frame = 0;
- int opt_w, opt_h;
+ int opt_w = 4, opt_h = 4;
*p = *pict;
@@ -240,9 +236,6 @@ static int flashsv_encode_frame(AVCodecContext *avctx, uint8_t *buf,
}
}
- opt_w = 4;
- opt_h = 4;
-
if (buf_size < s->image_width * s->image_height * 3) {
//Conservative upper bound check for compressed data
av_log(avctx, AV_LOG_ERROR, "buf_size %d < %d\n",
OpenPOWER on IntegriCloud