diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-02-03 23:10:18 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-02-03 23:10:18 +0000 |
commit | ef9f8dd7305e39f5579b33abeec425c11f4f1b6d (patch) | |
tree | f399926c54eed075e7c268bc541e60afb08e386a | |
parent | 43e4d57f667dae98866ed56f3bcf5063f0e66c3a (diff) | |
download | ffmpeg-ef9f8dd7305e39f5579b33abeec425c11f4f1b6d.tar.gz |
Use pixel format descriptors for checking if the input format is
paletted. Simpler and more robust.
Originally committed as revision 21631 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavfilter/vf_crop.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/libavfilter/vf_crop.c b/libavfilter/vf_crop.c index e3944ef059..94d89d1e5b 100644 --- a/libavfilter/vf_crop.c +++ b/libavfilter/vf_crop.c @@ -24,6 +24,7 @@ */ #include "avfilter.h" +#include "libavutil/pixdesc.h" typedef struct { 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) ref2->data[0] += crop->y * ref2->linesize[0]; ref2->data[0] += (crop->x * crop->bpp) >> 3; - if (link->format != PIX_FMT_PAL8 && - link->format != PIX_FMT_BGR4_BYTE && - link->format != PIX_FMT_RGB4_BYTE && - link->format != PIX_FMT_BGR8 && - link->format != PIX_FMT_RGB8) { + if (!(av_pix_fmt_descriptors[link->format].flags & PIX_FMT_PAL)) { for (i = 1; i < 3; i ++) { if (ref2->data[i]) { ref2->data[i] += (crop->y >> crop->vsub) * ref2->linesize[i]; |