changeset 9261:931bb51f060e libavcodec

Merge some cases for reading raw data with different bit depths in BMP
author kostya
date Fri, 27 Mar 2009 16:31:47 +0000
parents 762d7bc58fb6
children 3c9a424163ee
files bmp.c
diffstat 1 files changed, 2 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/bmp.c	Thu Mar 26 12:41:11 2009 +0000
+++ b/bmp.c	Fri Mar 27 16:31:47 2009 +0000
@@ -244,6 +244,8 @@
     }else{
         switch(depth){
         case 1:
+        case 8:
+        case 24:
             for(i = 0; i < avctx->height; i++){
                 memcpy(ptr, buf, n);
                 buf += n;
@@ -261,20 +263,6 @@
                 ptr += linesize;
             }
             break;
-        case 8:
-            for(i = 0; i < avctx->height; i++){
-                memcpy(ptr, buf, avctx->width);
-                buf += n;
-                ptr += linesize;
-            }
-            break;
-        case 24:
-            for(i = 0; i < avctx->height; i++){
-                memcpy(ptr, buf, avctx->width*(depth>>3));
-                buf += n;
-                ptr += linesize;
-            }
-            break;
         case 16:
             for(i = 0; i < avctx->height; i++){
                 const uint16_t *src = (const uint16_t *) buf;