Commit e458ea74 authored by stefano's avatar stefano

Use pixel format descriptors for checking if the input format is

paletted. Simpler and more robust.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@21631 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 2db58d96
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
*/ */
#include "avfilter.h" #include "avfilter.h"
#include "libavutil/pixdesc.h"
typedef struct { typedef struct {
int x; ///< x offset of the non-cropped area with respect to the input area int x; ///< x offset of the non-cropped area with respect to the input area
...@@ -173,11 +174,7 @@ static void start_frame(AVFilterLink *link, AVFilterPicRef *picref) ...@@ -173,11 +174,7 @@ static void start_frame(AVFilterLink *link, AVFilterPicRef *picref)
ref2->data[0] += crop->y * ref2->linesize[0]; ref2->data[0] += crop->y * ref2->linesize[0];
ref2->data[0] += (crop->x * crop->bpp) >> 3; ref2->data[0] += (crop->x * crop->bpp) >> 3;
if (link->format != PIX_FMT_PAL8 && if (!(av_pix_fmt_descriptors[link->format].flags & PIX_FMT_PAL)) {
link->format != PIX_FMT_BGR4_BYTE &&
link->format != PIX_FMT_RGB4_BYTE &&
link->format != PIX_FMT_BGR8 &&
link->format != PIX_FMT_RGB8) {
for (i = 1; i < 3; i ++) { for (i = 1; i < 3; i ++) {
if (ref2->data[i]) { if (ref2->data[i]) {
ref2->data[i] += (crop->y >> crop->vsub) * ref2->linesize[i]; ref2->data[i] += (crop->y >> crop->vsub) * ref2->linesize[i];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment