57 uint8_t *dst, ptrdiff_t dst_linesize);
59 uint8_t *dst, ptrdiff_t dst_linesize,
95 uint8_t *dst, ptrdiff_t dst_linesize,
99 for (y = 0; y <
h; y++, dst += dst_linesize, src++)
100 for (x = 0; x <
w; x++)
101 dst[x] = src[x*src_linesize];
105 uint8_t *dst, ptrdiff_t dst_linesize)
111 uint8_t *dst, ptrdiff_t dst_linesize,
115 for (y = 0; y <
h; y++, dst += dst_linesize, src += 2)
116 for (x = 0; x <
w; x++)
117 *((uint16_t *)(dst + 2*x)) = *((uint16_t *)(src + x*src_linesize));
121 uint8_t *dst, ptrdiff_t dst_linesize)
127 uint8_t *dst, ptrdiff_t dst_linesize,
131 for (y = 0; y <
h; y++, dst += dst_linesize) {
132 for (x = 0; x <
w; x++) {
140 uint8_t *dst, ptrdiff_t dst_linesize)
146 uint8_t *dst, ptrdiff_t dst_linesize,
150 for (y = 0; y <
h; y++, dst += dst_linesize, src += 4) {
151 for (x = 0; x <
w; x++)
152 *((uint32_t *)(dst + 4*x)) = *((uint32_t *)(src + x*src_linesize));
157 uint8_t *dst, ptrdiff_t dst_linesize)
163 uint8_t *dst, ptrdiff_t dst_linesize,
167 for (y = 0; y <
h; y++, dst += dst_linesize, src += 6) {
168 for (x = 0; x <
w; x++) {
169 int64_t v =
AV_RB48(src + x*src_linesize);
176 uint8_t *dst, ptrdiff_t dst_linesize)
182 uint8_t *dst, ptrdiff_t dst_linesize,
186 for (y = 0; y <
h; y++, dst += dst_linesize, src += 8)
187 for (x = 0; x <
w; x++)
188 *((uint64_t *)(dst + 8*x)) = *((uint64_t *)(src + x*src_linesize));
192 uint8_t *dst, ptrdiff_t dst_linesize)
207 "dir values greater than 3 are deprecated, use the passthrough option instead\n");
215 "w:%d h:%d -> w:%d h:%d (passthrough mode)\n",
216 inlink->
w, inlink->
h, inlink->
w, inlink->
h);
231 outlink->
w = inlink->
h;
232 outlink->
h = inlink->
w;
240 for (
int i = 0; i < 4; i++) {
259 "w:%d h:%d dir:%d -> w:%d h:%d rotation:%s vflip:%d\n",
260 inlink->
w, inlink->
h, s->
dir, outlink->
w, outlink->
h,
261 s->
dir == 1 || s->
dir == 3 ?
"clockwise" :
"counterclockwise",
262 s->
dir == 0 || s->
dir == 3);
288 for (plane = 0; plane < s->
planes; plane++) {
289 int hsub = plane == 1 || plane == 2 ? s->
hsub : 0;
290 int vsub = plane == 1 || plane == 2 ? s->
vsub : 0;
295 int start = (outh * jobnr ) / nb_jobs;
296 int end = (outh * (jobnr+1)) / nb_jobs;
298 int dstlinesize, srclinesize;
303 dst = out->
data[
plane] + start * dstlinesize;
313 dst = out->
data[
plane] + dstlinesize * (outh - start - 1);
317 for (y = start; y < end - 7; y += 8) {
318 for (x = 0; x < outw - 7; x += 8) {
321 dst + (y - start) * dstlinesize + x * pixstep,
324 if (outw - x > 0 && end - y > 0)
327 dst + (y - start) * dstlinesize + x * pixstep,
328 dstlinesize, outw - x, end - y);
334 dst + (y - start) * dstlinesize + 0 * pixstep,
335 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",
416 .priv_class = &transpose_class,
418 .
inputs = avfilter_vf_transpose_inputs,
419 .
outputs = avfilter_vf_transpose_outputs,
#define AV_PIX_FMT_FLAG_PAL
Pixel format has a palette in data[1], values are indexes in this palette.
void(* transpose_8x8)(uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize)
AVFILTER_DEFINE_CLASS(transpose)
static void transpose_block_24_c(uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize, int w, int h)
AVRational av_div_q(AVRational b, AVRational c)
Divide one rational by another.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
This structure describes decoded (raw) audio or video data.
static void transpose_8x8_24_c(uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize)
static void transpose_8x8_32_c(uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize)
static void transpose_8x8_16_c(uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize)
#define AV_LOG_WARNING
Something somehow does not look correct.
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
Main libavfilter public API header.
int h
agreed upon image height
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.
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
static const AVFilterPad avfilter_vf_transpose_outputs[]
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.
const char * name
Pad name.
AVFilterLink ** inputs
array of pointers to input links
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
void(* transpose_block)(uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize, int w, int h)
static av_cold int end(AVCodecContext *avctx)
static void transpose_block_48_c(uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize, int w, int h)
#define AV_LOG_VERBOSE
Detailed information.
A filter pad used for either input or output.
A link between two filters.
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void * priv
private data for use by the filter
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
#define AV_PIX_FMT_FLAG_HWACCEL
Pixel format is an HW accelerated format.
simple assert() macros that are a bit more flexible than ISO C assert().
int w
agreed upon image width
static void transpose_8x8_48_c(uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize)
common internal API header
uint64_t flags
Combination of AV_PIX_FMT_FLAG_...
static void transpose_block_16_c(uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize, int w, int h)
uint8_t nb_components
The number of components each pixel has, (1-4)
int ff_filter_get_nb_threads(AVFilterContext *ctx)
Get number of threads for current filter instance.
typedef void(APIENTRY *FF_PFNGLACTIVETEXTUREPROC)(GLenum texture)
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 int query_formats(AVFilterContext *ctx)
AVFilterContext * src
source filter
static const AVOption transpose_options[]
static const AVFilterPad inputs[]
static void transpose_8x8_64_c(uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize)
static const AVFilterPad outputs[]
int format
agreed upon media format
int passthrough
PassthroughType, landscape passthrough mode enabled.
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 AVFrame * get_video_buffer(AVFilterLink *inlink, int w, int h)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_RB24
Used for passing data between threads.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(constint16_t *) pi >>8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(constint32_t *) pi >>24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(constfloat *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(constfloat *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(constfloat *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(constdouble *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(constdouble *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(constdouble *) pi *(1U<< 31))))#defineSET_CONV_FUNC_GROUP(ofmt, ifmt) staticvoidset_generic_function(AudioConvert *ac){}voidff_audio_convert_free(AudioConvert **ac){if(!*ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);}AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enumAVSampleFormatout_fmt, enumAVSampleFormatin_fmt, intchannels, intsample_rate, intapply_map){AudioConvert *ac;intin_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) returnNULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method!=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt)>2){ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc){av_free(ac);returnNULL;}returnac;}in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar){ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar?ac->channels:1;}elseif(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;elseac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);returnac;}intff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in){intuse_generic=1;intlen=in->nb_samples;intp;if(ac->dc){av_log(ac->avr, AV_LOG_TRACE,"%dsamples-audio_convert:%sto%s(dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));returnff_convert_dither(ac-> in
Describe the class of an AVClass context structure.
Rational number (pair of numerator and denominator).
const char * name
Filter name.
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
GLsizei GLboolean transpose
#define AV_PIX_FMT_FLAG_BITSTREAM
All values of a component are bit-wise packed end to end.
AVFilterLink ** outputs
array of pointers to output links
static enum AVPixelFormat pix_fmts[]
#define flags(name, subs,...)
AVFilterInternal * internal
An opaque struct for libavfilter internal use.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
AVFrame * ff_default_get_video_buffer(AVFilterLink *link, int w, int h)
avfilter_execute_func * execute
AVFilterContext * dst
dest filter
static const AVFilterPad avfilter_vf_transpose_inputs[]
static void transpose_8x8_8_c(uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize)
static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
static int config_props_output(AVFilterLink *outlink)
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
#define AV_CEIL_RSHIFT(a, b)
static void transpose_block_32_c(uint8_t *src, ptrdiff_t src_linesize, uint8_t *dst, ptrdiff_t dst_linesize, int w, int h)