]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/imgconvert.c
10l to Benoit, poll.h is already included below, and this broke compilation on mingw
[ffmpeg] / libavcodec / imgconvert.c
index 2971afaa89eaebfd0d588ff186ad83c9a1f49273..7fe88c8344b5a7e32998cdb43ef5ac57ae702986 100644 (file)
 #include "avcodec.h"
 #include "dsputil.h"
 
-#ifdef USE_FASTMEMCPY
-#include "libvo/fastmemcpy.h"
-#endif
-
 #ifdef HAVE_MMX
 #include "i386/mmx.h"
 #endif
@@ -382,6 +378,27 @@ enum PixelFormat avcodec_get_pix_fmt(const char* name)
     return i;
 }
 
+void avcodec_pix_fmt_string (char *buf, int buf_size, int pix_fmt)
+{
+    PixFmtInfo info= pix_fmt_info[pix_fmt];
+
+    char is_alpha_char= info.is_alpha ? 'y' : 'n';
+
+    /* print header */
+    if (pix_fmt < 0)
+        snprintf (buf, buf_size,
+                  "name      " " nb_channels" " depth" " is_alpha"
+            );
+    else
+        snprintf (buf, buf_size,
+                  "%-10s" "      %1d     " "   %2d " "     %c   ",
+                  info.name,
+                  info.nb_channels,
+                  info.depth,
+                  is_alpha_char
+            );
+}
+
 int avpicture_fill(AVPicture *picture, uint8_t *ptr,
                    int pix_fmt, int width, int height)
 {
@@ -1886,7 +1903,9 @@ static void gray16be_to_gray(AVPicture *dst, const AVPicture *src,
 static void gray16le_to_gray(AVPicture *dst, const AVPicture *src,
                               int width, int height)
 {
-    gray16_to_gray(dst, src + 1, width, height);
+    AVPicture tmpsrc = *src;
+    tmpsrc.data[0]++;
+    gray16_to_gray(dst, &tmpsrc, width, height);
 }
 
 static void gray16_to_gray16(AVPicture *dst, const AVPicture *src,