changeset 12429:305987348a98 libavcodec

Clarify code/avoid possible bugs by using precalculated values that are used for extradata as well
author bindhammer
date Thu, 26 Aug 2010 10:03:06 +0000
parents 06453ad84991
children 417532548504
files a64multienc.c
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/a64multienc.c	Thu Aug 26 10:03:03 2010 +0000
+++ b/a64multienc.c	Thu Aug 26 10:03:06 2010 +0000
@@ -291,15 +291,15 @@
             render_charset(avctx, charset, colram);
 
             /* copy charset to buf */
-            memcpy(buf,charset,0x800*(INTERLACED+1));
+            memcpy(buf,charset, charset_size);
 
             /* advance pointers */
-            buf      += 0x800*(INTERLACED+1);
-            charset  += 0x800*(INTERLACED+1);
-            req_size += 0x800*(INTERLACED+1);
+            buf      += charset_size;
+            charset  += charset_size;
+            req_size += charset_size;
         }
         /* no charset so clean buf */
-        else memset(buf,0,0x800*(INTERLACED+1));
+        else memset(buf, 0, charset_size);
 
         /* write x frames to buf */
         for (frame = 0; frame < c->mc_lifetime; frame++) {
@@ -308,15 +308,15 @@
                 buf[a] = charmap[a];
             }
             /* advance pointers */
-            buf += 0x400;
-            req_size += 0x400;
+            buf += screen_size;
+            req_size += screen_size;
 
             /* compress and copy colram to buf */
             if(c->mc_use_5col) {
                 a64_compress_colram(buf,charmap,colram);
                 /* advance pointers */
-                buf += 0x100;
-                req_size += 0x100;
+                buf += colram_size;
+                req_size += colram_size;
             }
 
             /* advance to next charmap */