Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1167)

Unified Diff: patched-ffmpeg-mt/libavcodec/imgconvert.c

Issue 789004: ffmpeg roll of source to mar 9 version... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/ffmpeg/
Patch Set: '' Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: patched-ffmpeg-mt/libavcodec/imgconvert.c
===================================================================
--- patched-ffmpeg-mt/libavcodec/imgconvert.c (revision 41250)
+++ patched-ffmpeg-mt/libavcodec/imgconvert.c (working copy)
@@ -33,6 +33,8 @@
#include "avcodec.h"
#include "dsputil.h"
#include "colorspace.h"
+#include "internal.h"
+#include "imgconvert.h"
#include "libavutil/pixdesc.h"
#if HAVE_MMX
@@ -238,6 +240,18 @@
.pixel_type = FF_PIXEL_PACKED,
.depth = 5,
},
+ [PIX_FMT_RGB444BE] = {
+ .nb_channels = 3,
+ .color_type = FF_COLOR_RGB,
+ .pixel_type = FF_PIXEL_PACKED,
+ .depth = 4,
+ },
+ [PIX_FMT_RGB444LE] = {
+ .nb_channels = 3,
+ .color_type = FF_COLOR_RGB,
+ .pixel_type = FF_PIXEL_PACKED,
+ .depth = 4,
+ },
/* gray / mono formats */
[PIX_FMT_GRAY16BE] = {
@@ -314,6 +328,18 @@
.pixel_type = FF_PIXEL_PACKED,
.depth = 5,
},
+ [PIX_FMT_BGR444BE] = {
+ .nb_channels = 3,
+ .color_type = FF_COLOR_RGB,
+ .pixel_type = FF_PIXEL_PACKED,
+ .depth = 4,
+ },
+ [PIX_FMT_BGR444LE] = {
+ .nb_channels = 3,
+ .color_type = FF_COLOR_RGB,
+ .pixel_type = FF_PIXEL_PACKED,
+ .depth = 4,
+ },
[PIX_FMT_RGB8] = {
.nb_channels = 1,
.color_type = FF_COLOR_RGB,
@@ -527,10 +553,14 @@
break;
case PIX_FMT_GRAY16BE:
case PIX_FMT_GRAY16LE:
+ case PIX_FMT_BGR444BE:
+ case PIX_FMT_BGR444LE:
case PIX_FMT_BGR555BE:
case PIX_FMT_BGR555LE:
case PIX_FMT_BGR565BE:
case PIX_FMT_BGR565LE:
+ case PIX_FMT_RGB444BE:
+ case PIX_FMT_RGB444LE:
case PIX_FMT_RGB555BE:
case PIX_FMT_RGB555LE:
case PIX_FMT_RGB565BE:
@@ -624,10 +654,14 @@
case PIX_FMT_RGB48LE:
case PIX_FMT_GRAY16BE:
case PIX_FMT_GRAY16LE:
+ case PIX_FMT_BGR444BE:
+ case PIX_FMT_BGR444LE:
case PIX_FMT_BGR555BE:
case PIX_FMT_BGR555LE:
case PIX_FMT_BGR565BE:
case PIX_FMT_BGR565LE:
+ case PIX_FMT_RGB444BE:
+ case PIX_FMT_RGB444LE:
case PIX_FMT_RGB555BE:
case PIX_FMT_RGB555LE:
case PIX_FMT_RGB565BE:
@@ -697,10 +731,14 @@
pix_fmt == PIX_FMT_BGR565LE ||
pix_fmt == PIX_FMT_BGR555BE ||
pix_fmt == PIX_FMT_BGR555LE ||
+ pix_fmt == PIX_FMT_BGR444BE ||
+ pix_fmt == PIX_FMT_BGR444LE ||
pix_fmt == PIX_FMT_RGB565BE ||
pix_fmt == PIX_FMT_RGB565LE ||
pix_fmt == PIX_FMT_RGB555BE ||
- pix_fmt == PIX_FMT_RGB555LE)
+ pix_fmt == PIX_FMT_RGB555LE ||
+ pix_fmt == PIX_FMT_RGB444BE ||
+ pix_fmt == PIX_FMT_RGB444LE)
w = width * 2;
else if (pix_fmt == PIX_FMT_UYYVYY411)
w = width + width/2;
@@ -722,8 +760,8 @@
for (i=0; i<data_planes; i++) {
if (i == 1) {
- w = ((width >> desc->log2_chroma_w) * pf->depth + 7) / 8;
- h = height >> desc->log2_chroma_h;
+ w = (- ((-width) >> desc->log2_chroma_w) * pf->depth + 7) / 8;
+ h = -((-height) >> desc->log2_chroma_h);
if (pix_fmt == PIX_FMT_NV12 || pix_fmt == PIX_FMT_NV21)
w <<= 1;
} else if (i == 3) {
@@ -775,8 +813,10 @@
loss = 0;
pf = &pix_fmt_info[dst_pix_fmt];
if (pf->depth < ps->depth ||
- ((dst_pix_fmt == PIX_FMT_RGB555BE || dst_pix_fmt == PIX_FMT_RGB555LE) &&
- (src_pix_fmt == PIX_FMT_RGB565BE || src_pix_fmt == PIX_FMT_RGB565LE)))
+ ((dst_pix_fmt == PIX_FMT_RGB555BE || dst_pix_fmt == PIX_FMT_RGB555LE ||
+ dst_pix_fmt == PIX_FMT_BGR555BE || dst_pix_fmt == PIX_FMT_BGR555LE) &&
+ (src_pix_fmt == PIX_FMT_RGB565BE || src_pix_fmt == PIX_FMT_RGB565LE ||
+ src_pix_fmt == PIX_FMT_BGR565BE || src_pix_fmt == PIX_FMT_BGR565LE)))
loss |= FF_LOSS_DEPTH;
if (dst_desc->log2_chroma_w > src_desc->log2_chroma_w ||
dst_desc->log2_chroma_h > src_desc->log2_chroma_h)
@@ -834,10 +874,14 @@
case PIX_FMT_RGB565LE:
case PIX_FMT_RGB555BE:
case PIX_FMT_RGB555LE:
+ case PIX_FMT_RGB444BE:
+ case PIX_FMT_RGB444LE:
case PIX_FMT_BGR565BE:
case PIX_FMT_BGR565LE:
case PIX_FMT_BGR555BE:
case PIX_FMT_BGR555LE:
+ case PIX_FMT_BGR444BE:
+ case PIX_FMT_BGR444LE:
bits = 16;
break;
case PIX_FMT_UYYVYY411:
@@ -954,10 +998,14 @@
case PIX_FMT_RGB565LE:
case PIX_FMT_RGB555BE:
case PIX_FMT_RGB555LE:
+ case PIX_FMT_RGB444BE:
+ case PIX_FMT_RGB444LE:
case PIX_FMT_BGR565BE:
case PIX_FMT_BGR565LE:
case PIX_FMT_BGR555BE:
case PIX_FMT_BGR555LE:
+ case PIX_FMT_BGR444BE:
+ case PIX_FMT_BGR444LE:
bits = 16;
break;
case PIX_FMT_UYYVYY411:

Powered by Google App Engine
This is Rietveld 408576698