changeset 8889:b4838c71d52a libavcodec

Merge some declarations and initializations.
author diego
date Sat, 14 Feb 2009 22:21:17 +0000
parents 5b7c6ebb4a36
children 21e7e2e89379
files mpegvideo_xvmc.c
diffstat 1 files changed, 4 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/mpegvideo_xvmc.c	Sat Feb 14 22:06:00 2009 +0000
+++ b/mpegvideo_xvmc.c	Sat Feb 14 22:21:17 2009 +0000
@@ -34,8 +34,7 @@
 //set s->block
 void ff_xvmc_init_block(MpegEncContext *s)
 {
-    struct xvmc_render_state *render;
-    render = (struct xvmc_render_state*)s->current_picture.data[2];
+    struct xvmc_render_state *render = (struct xvmc_render_state*)s->current_picture.data[2];
     assert(render);
     if (!render || render->magic != AV_XVMC_RENDER_MAGIC) {
         assert(0);
@@ -46,10 +45,9 @@
 
 void ff_xvmc_pack_pblocks(MpegEncContext *s, int cbp)
 {
-    int i, j;
+    int i, j = 0;
     const int mb_block_count = 4 + (1 << s->chroma_format);
 
-    j = 0;
     cbp <<= 12-mb_block_count;
     for (i = 0; i < mb_block_count; i++) {
         if (cbp & (1 << 11))
@@ -64,11 +62,9 @@
 // They should be safe if they are called a few times for the same field!
 int ff_xvmc_field_start(MpegEncContext*s, AVCodecContext *avctx)
 {
-    struct xvmc_render_state *render, *last, *next;
+    struct xvmc_render_state *last, *next, *render = (struct xvmc_render_state*)s->current_picture.data[2];
 
     assert(avctx);
-
-    render = (struct xvmc_render_state*)s->current_picture.data[2];
     assert(render);
     if (!render || render->magic != AV_XVMC_RENDER_MAGIC)
         return -1; // make sure that this is a render packet
@@ -113,8 +109,7 @@
 
 void ff_xvmc_field_end(MpegEncContext *s)
 {
-    struct xvmc_render_state *render;
-    render = (struct xvmc_render_state*)s->current_picture.data[2];
+    struct xvmc_render_state *render = (struct xvmc_render_state*)s->current_picture.data[2];
     assert(render);
 
     if (render->filled_mv_blocks_num > 0)