[FFmpeg-cvslog] r19626 - trunk/libavcodec/imgconvert.c

cehoyos subversion
Tue Aug 11 18:18:55 CEST 2009


Author: cehoyos
Date: Tue Aug 11 18:18:55 2009
New Revision: 19626

Log:
Use RGB5x5LE, RGB5x5BE, BGR5x5LE and BGR5x5BE instead of their native
endian counterparts.

Patch by Alexis Ballier, alexis D ballier gmail

Modified:
   trunk/libavcodec/imgconvert.c

Modified: trunk/libavcodec/imgconvert.c
==============================================================================
--- trunk/libavcodec/imgconvert.c	Tue Aug 11 09:04:33 2009	(r19625)
+++ trunk/libavcodec/imgconvert.c	Tue Aug 11 18:18:55 2009	(r19626)
@@ -702,10 +702,14 @@ int ff_fill_linesize(AVPicture *picture,
         break;
     case PIX_FMT_GRAY16BE:
     case PIX_FMT_GRAY16LE:
-    case PIX_FMT_BGR555:
-    case PIX_FMT_BGR565:
-    case PIX_FMT_RGB555:
-    case PIX_FMT_RGB565:
+    case PIX_FMT_BGR555BE:
+    case PIX_FMT_BGR555LE:
+    case PIX_FMT_BGR565BE:
+    case PIX_FMT_BGR565LE:
+    case PIX_FMT_RGB555BE:
+    case PIX_FMT_RGB555LE:
+    case PIX_FMT_RGB565BE:
+    case PIX_FMT_RGB565LE:
     case PIX_FMT_YUYV422:
         picture->linesize[0] = width * 2;
         break;
@@ -796,10 +800,14 @@ int ff_fill_pointer(AVPicture *picture, 
     case PIX_FMT_RGB48LE:
     case PIX_FMT_GRAY16BE:
     case PIX_FMT_GRAY16LE:
-    case PIX_FMT_BGR555:
-    case PIX_FMT_BGR565:
-    case PIX_FMT_RGB555:
-    case PIX_FMT_RGB565:
+    case PIX_FMT_BGR555BE:
+    case PIX_FMT_BGR555LE:
+    case PIX_FMT_BGR565BE:
+    case PIX_FMT_BGR565LE:
+    case PIX_FMT_RGB555BE:
+    case PIX_FMT_RGB555LE:
+    case PIX_FMT_RGB565BE:
+    case PIX_FMT_RGB565LE:
     case PIX_FMT_YUYV422:
     case PIX_FMT_UYVY422:
     case PIX_FMT_UYYVYY411:
@@ -860,10 +868,14 @@ int avpicture_layout(const AVPicture* sr
     if (pf->pixel_type == FF_PIXEL_PACKED || pf->pixel_type == FF_PIXEL_PALETTE) {
         if (pix_fmt == PIX_FMT_YUYV422 ||
             pix_fmt == PIX_FMT_UYVY422 ||
-            pix_fmt == PIX_FMT_BGR565 ||
-            pix_fmt == PIX_FMT_BGR555 ||
-            pix_fmt == PIX_FMT_RGB565 ||
-            pix_fmt == PIX_FMT_RGB555)
+            pix_fmt == PIX_FMT_BGR565BE ||
+            pix_fmt == PIX_FMT_BGR565LE ||
+            pix_fmt == PIX_FMT_BGR555BE ||
+            pix_fmt == PIX_FMT_BGR555LE ||
+            pix_fmt == PIX_FMT_RGB565BE ||
+            pix_fmt == PIX_FMT_RGB565LE ||
+            pix_fmt == PIX_FMT_RGB555BE ||
+            pix_fmt == PIX_FMT_RGB555LE)
             w = width * 2;
         else if (pix_fmt == PIX_FMT_UYYVYY411)
           w = width + width/2;
@@ -934,7 +946,8 @@ int avcodec_get_pix_fmt_loss(enum PixelF
     loss = 0;
     pf = &pix_fmt_info[dst_pix_fmt];
     if (pf->depth < ps->depth ||
-        (dst_pix_fmt == PIX_FMT_RGB555 && src_pix_fmt == PIX_FMT_RGB565))
+        ((dst_pix_fmt == PIX_FMT_RGB555BE || dst_pix_fmt == PIX_FMT_RGB555LE) &&
+         (src_pix_fmt == PIX_FMT_RGB565BE || src_pix_fmt == PIX_FMT_RGB565LE)))
         loss |= FF_LOSS_DEPTH;
     if (pf->x_chroma_shift > ps->x_chroma_shift ||
         pf->y_chroma_shift > ps->y_chroma_shift)
@@ -987,10 +1000,14 @@ static int avg_bits_per_pixel(enum Pixel
         switch(pix_fmt) {
         case PIX_FMT_YUYV422:
         case PIX_FMT_UYVY422:
-        case PIX_FMT_RGB565:
-        case PIX_FMT_RGB555:
-        case PIX_FMT_BGR565:
-        case PIX_FMT_BGR555:
+        case PIX_FMT_RGB565BE:
+        case PIX_FMT_RGB565LE:
+        case PIX_FMT_RGB555BE:
+        case PIX_FMT_RGB555LE:
+        case PIX_FMT_BGR565BE:
+        case PIX_FMT_BGR565LE:
+        case PIX_FMT_BGR555BE:
+        case PIX_FMT_BGR555LE:
             bits = 16;
             break;
         case PIX_FMT_UYYVYY411:
@@ -1102,10 +1119,14 @@ int ff_get_plane_bytewidth(enum PixelFor
         switch(pix_fmt) {
         case PIX_FMT_YUYV422:
         case PIX_FMT_UYVY422:
-        case PIX_FMT_RGB565:
-        case PIX_FMT_RGB555:
-        case PIX_FMT_BGR565:
-        case PIX_FMT_BGR555:
+        case PIX_FMT_RGB565BE:
+        case PIX_FMT_RGB565LE:
+        case PIX_FMT_RGB555BE:
+        case PIX_FMT_RGB555LE:
+        case PIX_FMT_BGR565BE:
+        case PIX_FMT_BGR565LE:
+        case PIX_FMT_BGR555BE:
+        case PIX_FMT_BGR555LE:
             bits = 16;
             break;
         case PIX_FMT_UYYVYY411:



More information about the ffmpeg-cvslog mailing list