67 desc->log2_chroma_w !=
desc->log2_chroma_h) &&
77 uint8_t *
dst, ptrdiff_t dst_linesize,
81 for (y = 0; y <
h; y++,
dst += dst_linesize,
src++)
82 for (x = 0; x <
w; x++)
83 dst[x] =
src[x*src_linesize];
87 uint8_t *
dst, ptrdiff_t dst_linesize)
93 uint8_t *
dst, ptrdiff_t dst_linesize,
97 for (y = 0; y <
h; y++,
dst += dst_linesize,
src += 2)
98 for (x = 0; x <
w; x++)
99 *((uint16_t *)(
dst + 2*x)) = *((uint16_t *)(
src + x*src_linesize));
103 uint8_t *
dst, ptrdiff_t dst_linesize)
109 uint8_t *
dst, ptrdiff_t dst_linesize,
113 for (y = 0; y <
h; y++,
dst += dst_linesize) {
114 for (x = 0; x <
w; x++) {
122 uint8_t *
dst, ptrdiff_t dst_linesize)
128 uint8_t *
dst, ptrdiff_t dst_linesize,
132 for (y = 0; y <
h; y++,
dst += dst_linesize,
src += 4) {
133 for (x = 0; x <
w; x++)
134 *((uint32_t *)(
dst + 4*x)) = *((uint32_t *)(
src + x*src_linesize));
139 uint8_t *
dst, ptrdiff_t dst_linesize)
145 uint8_t *
dst, ptrdiff_t dst_linesize,
149 for (y = 0; y <
h; y++,
dst += dst_linesize,
src += 6) {
150 for (x = 0; x <
w; x++) {
158 uint8_t *
dst, ptrdiff_t dst_linesize)
164 uint8_t *
dst, ptrdiff_t dst_linesize,
168 for (y = 0; y <
h; y++,
dst += dst_linesize,
src += 8)
169 for (x = 0; x <
w; x++)
170 *((uint64_t *)(
dst + 8*x)) = *((uint64_t *)(
src + x*src_linesize));
174 uint8_t *
dst, ptrdiff_t dst_linesize)
189 "dir values greater than 3 are deprecated, use the passthrough option instead\n");
197 "w:%d h:%d -> w:%d h:%d (passthrough mode)\n",
198 inlink->
w, inlink->
h, inlink->
w, inlink->
h);
213 outlink->
w = inlink->
h;
214 outlink->
h = inlink->
w;
222 for (
int i = 0;
i < 4;
i++) {
224 switch (
s->pixsteps[
i]) {
240#if ARCH_X86 && HAVE_X86ASM
241 for (
int i = 0;
i < 4;
i++) {
249 "w:%d h:%d dir:%d -> w:%d h:%d rotation:%s vflip:%d\n",
250 inlink->
w, inlink->
h,
s->dir, outlink->
w, outlink->
h,
251 s->dir == 1 ||
s->dir == 3 ?
"clockwise" :
"counterclockwise",
252 s->dir == 0 ||
s->dir == 3);
260 return s->passthrough ?
278 for (plane = 0; plane <
s->planes; plane++) {
279 int hsub = plane == 1 || plane == 2 ?
s->hsub : 0;
280 int vsub = plane == 1 || plane == 2 ?
s->vsub : 0;
281 int pixstep =
s->pixsteps[plane];
288 int dstlinesize, srclinesize;
292 dstlinesize =
out->linesize[plane];
293 dst =
out->data[plane] + start * dstlinesize;
303 dst =
out->data[plane] + dstlinesize * (outh - start - 1);
307 for (y = start; y < end - 7; y += 8) {
308 for (x = 0; x < outw - 7; x += 8) {
311 dst + (y - start) * dstlinesize + x * pixstep,
314 if (outw - x > 0 && end - y > 0)
317 dst + (y - start) * dstlinesize + x * pixstep,
318 dstlinesize, outw - x, end - y);
324 dst + (y - start) * dstlinesize + 0 * pixstep,
325 dstlinesize, outw, end - y);
372#define OFFSET(x) offsetof(TransContext, x)
373#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
382 {
"passthrough",
"do not apply transposition if the input matches the specified geometry",
411 .p.name =
"transpose",
413 .p.priv_class = &transpose_class,
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
const FFFilter ff_vf_transpose
static AVFormatContext * ctx
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static AVFrame * get_video_buffer(AVFilterLink *inlink, int w, int h)
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs)
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
Main libavfilter public API header.
#define i(width, name, range_min, range_max)
#define AV_CEIL_RSHIFT(a, b)
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
@ AV_OPT_TYPE_INT
Underlying C type is int.
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_VERBOSE
Detailed information.
AVRational av_div_q(AVRational b, AVRational c)
Divide one rational by another.
void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4], const AVPixFmtDescriptor *pixdesc)
Compute the max pixel step for each plane of an image with a format described by pixdesc.
#define FILTER_INPUTS(array)
#define FILTER_OUTPUTS(array)
static int ff_slice_pos(int total, int jobnr, int nb_jobs)
Compute the boundary index for a slice when work of size total is split into nb_jobs slices.
#define AVFILTER_DEFINE_CLASS(fname)
#define FILTER_QUERY_FUNC2(func)
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static enum AVPixelFormat pix_fmts[]
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AV_PIX_FMT_FLAG_BITSTREAM
All values of a component are bit-wise packed end to end.
#define AV_PIX_FMT_FLAG_HWACCEL
Pixel format is an HW accelerated format.
#define AV_PIX_FMT_FLAG_PAL
Pixel format has a palette in data[1], values are indexes in this palette.
Describe the class of an AVClass context structure.
void * priv
private data for use by the filter
A link between two filters.
int w
agreed upon image width
int h
agreed upon image height
AVFilterContext * src
source filter
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
AVFilterContext * dst
dest filter
int format
agreed upon media format
A filter pad used for either input or output.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
uint8_t nb_components
The number of components each pixel has, (1-4)
Rational number (pair of numerator and denominator).
Used for passing data between threads.
int passthrough
PassthroughType, landscape passthrough mode enabled.
void(* transpose_block)(uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize, int w, int h)
void(* transpose_8x8)(uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize)
void ff_transpose_init_x86(TransVtable *v, int pixstep)
@ TRANSPOSE_PT_TYPE_PORTRAIT
@ TRANSPOSE_PT_TYPE_LANDSCAPE
static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int config_props_output(AVFilterLink *outlink)
static void transpose_block_32_c(uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize, int w, int h)
static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static void transpose_8x8_32_c(uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize)
static void transpose_block_64_c(uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize, int w, int h)
static AVFrame * get_video_buffer(AVFilterLink *inlink, int w, int h)
static void transpose_8x8_64_c(uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize)
static void transpose_8x8_24_c(uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize)
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
static const AVFilterPad avfilter_vf_transpose_inputs[]
static const AVOption transpose_options[]
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
static void transpose_8x8_16_c(uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize)
static void transpose_block_8_c(uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize, int w, int h)
static void transpose_block_24_c(uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize, int w, int h)
static void transpose_block_48_c(uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize, int w, int h)
static int config_props_output(AVFilterLink *outlink)
static void transpose_8x8_8_c(uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize)
static void transpose_block_16_c(uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize, int w, int h)
static void transpose_8x8_48_c(uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize)
static const AVFilterPad avfilter_vf_transpose_outputs[]
AVFrame * ff_null_get_video_buffer(AVFilterLink *link, int w, int h)
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
AVFrame * ff_default_get_video_buffer(AVFilterLink *link, int w, int h)