aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-02-12 13:45:23 +0000
committerPaul B Mahol <onemda@gmail.com>2013-02-13 16:29:47 +0000
commit34126cd090c38250b3002169843d60f4e4c3beb6 (patch)
treed1925c079be28759366b0f2ece2c310b24341e74
parentcf73e0bff3a28c79aa6d89eca0122c3466efda82 (diff)
downloadffmpeg-34126cd090c38250b3002169843d60f4e4c3beb6.tar.gz
lavfi/transpose: support more pix fmts
Signed-off-by: Paul B Mahol <onemda@gmail.com>
-rw-r--r--libavfilter/vf_transpose.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/libavfilter/vf_transpose.c b/libavfilter/vf_transpose.c
index c381ecc74e..270d346f05 100644
--- a/libavfilter/vf_transpose.c
+++ b/libavfilter/vf_transpose.c
@@ -86,28 +86,20 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
static int query_formats(AVFilterContext *ctx)
{
- static const enum AVPixelFormat pix_fmts[] = {
- AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA,
- AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA,
- AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24,
- AV_PIX_FMT_RGB565BE, AV_PIX_FMT_RGB565LE,
- AV_PIX_FMT_RGB555BE, AV_PIX_FMT_RGB555LE,
- AV_PIX_FMT_BGR565BE, AV_PIX_FMT_BGR565LE,
- AV_PIX_FMT_BGR555BE, AV_PIX_FMT_BGR555LE,
- AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_GRAY16LE,
- AV_PIX_FMT_YUV420P16LE, AV_PIX_FMT_YUV420P16BE,
- AV_PIX_FMT_YUV444P16LE, AV_PIX_FMT_YUV444P16BE,
- AV_PIX_FMT_NV12, AV_PIX_FMT_NV21,
- AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8,
- AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE,
- AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P,
- AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P,
- AV_PIX_FMT_YUV410P,
- AV_PIX_FMT_YUVA420P, AV_PIX_FMT_GRAY8,
- AV_PIX_FMT_NONE
- };
-
- ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
+ AVFilterFormats *pix_fmts = NULL;
+ int fmt;
+
+ for (fmt = 0; fmt < AV_PIX_FMT_NB; fmt++) {
+ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(fmt);
+ if (!(desc->flags & PIX_FMT_PAL ||
+ desc->flags & PIX_FMT_HWACCEL ||
+ desc->flags & PIX_FMT_BITSTREAM ||
+ desc->log2_chroma_w != desc->log2_chroma_h))
+ ff_add_format(&pix_fmts, fmt);
+ }
+
+
+ ff_set_common_formats(ctx, pix_fmts);
return 0;
}
@@ -236,6 +228,16 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *in)
for (x = 0; x < outw; x++)
*((uint32_t *)(dst + 4*x)) = *((uint32_t *)(src + x*srclinesize + y*4));
break;
+ case 6:
+ for (x = 0; x < outw; x++) {
+ int64_t v = AV_RB48(src + x*srclinesize + y*6);
+ AV_WB48(dst + 6*x, v);
+ }
+ break;
+ case 8:
+ for (x = 0; x < outw; x++)
+ *((uint64_t *)(dst + 8*x)) = *((uint64_t *)(src + x*srclinesize + y*8));
+ break;
}
dst += dstlinesize;
}