FFmpeg
vf_swaprect.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Paul B. Mahol
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #include "libavutil/avstring.h"
22 #include "libavutil/eval.h"
23 #include "libavutil/imgutils.h"
24 #include "libavutil/opt.h"
25 #include "libavutil/pixdesc.h"
26 
27 #include "avfilter.h"
28 #include "formats.h"
29 #include "internal.h"
30 #include "video.h"
31 
32 typedef struct SwapRectContext {
33  const AVClass *class;
34  char *w, *h;
35  char *x1, *y1;
36  char *x2, *y2;
37 
38  int nb_planes;
39  int pixsteps[4];
40 
44 
45 #define OFFSET(x) offsetof(SwapRectContext, x)
46 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
47 static const AVOption swaprect_options[] = {
48  { "w", "set rect width", OFFSET(w), AV_OPT_TYPE_STRING, {.str="w/2"}, 0, 0, .flags = FLAGS },
49  { "h", "set rect height", OFFSET(h), AV_OPT_TYPE_STRING, {.str="h/2"}, 0, 0, .flags = FLAGS },
50  { "x1", "set 1st rect x top left coordinate", OFFSET(x1), AV_OPT_TYPE_STRING, {.str="w/2"}, 0, 0, .flags = FLAGS },
51  { "y1", "set 1st rect y top left coordinate", OFFSET(y1), AV_OPT_TYPE_STRING, {.str="h/2"}, 0, 0, .flags = FLAGS },
52  { "x2", "set 2nd rect x top left coordinate", OFFSET(x2), AV_OPT_TYPE_STRING, {.str="0"}, 0, 0, .flags = FLAGS },
53  { "y2", "set 2nd rect y top left coordinate", OFFSET(y2), AV_OPT_TYPE_STRING, {.str="0"}, 0, 0, .flags = FLAGS },
54  { NULL },
55 };
56 
57 AVFILTER_DEFINE_CLASS(swaprect);
58 
60 {
62  int fmt, ret;
63 
64  for (fmt = 0; av_pix_fmt_desc_get(fmt); fmt++) {
66  if (!(desc->flags & AV_PIX_FMT_FLAG_PAL ||
67  desc->flags & AV_PIX_FMT_FLAG_HWACCEL ||
68  desc->flags & AV_PIX_FMT_FLAG_BITSTREAM) &&
69  (ret = ff_add_format(&pix_fmts, fmt)) < 0)
70  return ret;
71  }
72 
74 }
75 
76 static const char *const var_names[] = { "w", "h", "a", "n", "t", "pos", "sar", "dar", NULL };
78 
80 {
81  AVFilterContext *ctx = inlink->dst;
82  AVFilterLink *outlink = ctx->outputs[0];
83  SwapRectContext *s = ctx->priv;
84  double var_values[VAR_VARS_NB];
85  int x1[4], y1[4];
86  int x2[4], y2[4];
87  int aw[4], ah[4];
88  int lw[4], lh[4];
89  int pw[4], ph[4];
90  double dw, dh;
91  double dx1, dy1;
92  double dx2, dy2;
93  int y, p, w, h, ret;
94 
95  var_values[VAR_W] = inlink->w;
96  var_values[VAR_H] = inlink->h;
97  var_values[VAR_A] = (float) inlink->w / inlink->h;
98  var_values[VAR_SAR] = inlink->sample_aspect_ratio.num ? av_q2d(inlink->sample_aspect_ratio) : 1;
99  var_values[VAR_DAR] = var_values[VAR_A] * var_values[VAR_SAR];
100  var_values[VAR_N] = inlink->frame_count_out;
101  var_values[VAR_T] = in->pts == AV_NOPTS_VALUE ? NAN : in->pts * av_q2d(inlink->time_base);
102  var_values[VAR_POS] = in->pkt_pos == -1 ? NAN : in->pkt_pos;
103 
104  ret = av_expr_parse_and_eval(&dw, s->w,
105  var_names, &var_values[0],
106  NULL, NULL, NULL, NULL,
107  0, 0, ctx);
108  if (ret < 0)
109  return ret;
110 
111  ret = av_expr_parse_and_eval(&dh, s->h,
112  var_names, &var_values[0],
113  NULL, NULL, NULL, NULL,
114  0, 0, ctx);
115  if (ret < 0)
116  return ret;
117 
118  ret = av_expr_parse_and_eval(&dx1, s->x1,
119  var_names, &var_values[0],
120  NULL, NULL, NULL, NULL,
121  0, 0, ctx);
122  if (ret < 0)
123  return ret;
124 
125  ret = av_expr_parse_and_eval(&dy1, s->y1,
126  var_names, &var_values[0],
127  NULL, NULL, NULL, NULL,
128  0, 0, ctx);
129  if (ret < 0)
130  return ret;
131 
132  ret = av_expr_parse_and_eval(&dx2, s->x2,
133  var_names, &var_values[0],
134  NULL, NULL, NULL, NULL,
135  0, 0, ctx);
136  if (ret < 0)
137  return ret;
138 
139  ret = av_expr_parse_and_eval(&dy2, s->y2,
140  var_names, &var_values[0],
141  NULL, NULL, NULL, NULL,
142  0, 0, ctx);
143  if (ret < 0)
144  return ret;
145 
146  w = dw; h = dh; x1[0] = dx1; y1[0] = dy1; x2[0] = dx2; y2[0] = dy2;
147 
148  x1[0] = av_clip(x1[0], 0, inlink->w - 1);
149  y1[0] = av_clip(y1[0], 0, inlink->w - 1);
150 
151  x2[0] = av_clip(x2[0], 0, inlink->w - 1);
152  y2[0] = av_clip(y2[0], 0, inlink->w - 1);
153 
154  ah[1] = ah[2] = AV_CEIL_RSHIFT(h, s->desc->log2_chroma_h);
155  ah[0] = ah[3] = h;
156  aw[1] = aw[2] = AV_CEIL_RSHIFT(w, s->desc->log2_chroma_w);
157  aw[0] = aw[3] = w;
158 
159  w = FFMIN3(w, inlink->w - x1[0], inlink->w - x2[0]);
160  h = FFMIN3(h, inlink->h - y1[0], inlink->h - y2[0]);
161 
162  ph[1] = ph[2] = AV_CEIL_RSHIFT(h, s->desc->log2_chroma_h);
163  ph[0] = ph[3] = h;
164  pw[1] = pw[2] = AV_CEIL_RSHIFT(w, s->desc->log2_chroma_w);
165  pw[0] = pw[3] = w;
166 
167  lh[1] = lh[2] = AV_CEIL_RSHIFT(inlink->h, s->desc->log2_chroma_h);
168  lh[0] = lh[3] = inlink->h;
169  lw[1] = lw[2] = AV_CEIL_RSHIFT(inlink->w, s->desc->log2_chroma_w);
170  lw[0] = lw[3] = inlink->w;
171 
172  x1[1] = x1[2] = AV_CEIL_RSHIFT(x1[0], s->desc->log2_chroma_w);
173  x1[0] = x1[3] = x1[0];
174  y1[1] = y1[2] = AV_CEIL_RSHIFT(y1[0], s->desc->log2_chroma_h);
175  y1[0] = y1[3] = y1[0];
176 
177  x2[1] = x2[2] = AV_CEIL_RSHIFT(x2[0], s->desc->log2_chroma_w);
178  x2[0] = x2[3] = x2[0];
179  y2[1] = y2[2] = AV_CEIL_RSHIFT(y2[0], s->desc->log2_chroma_h);
180  y2[0] = y2[3] = y2[0];
181 
182  for (p = 0; p < s->nb_planes; p++) {
183  if (ph[p] == ah[p] && pw[p] == aw[p]) {
184  uint8_t *src = in->data[p] + y1[p] * in->linesize[p] + x1[p] * s->pixsteps[p];
185  uint8_t *dst = in->data[p] + y2[p] * in->linesize[p] + x2[p] * s->pixsteps[p];
186 
187  for (y = 0; y < ph[p]; y++) {
188  memcpy(s->temp, src, pw[p] * s->pixsteps[p]);
189  memmove(src, dst, pw[p] * s->pixsteps[p]);
190  memcpy(dst, s->temp, pw[p] * s->pixsteps[p]);
191  src += in->linesize[p];
192  dst += in->linesize[p];
193  }
194  }
195  }
196 
197  return ff_filter_frame(outlink, in);
198 }
199 
201 {
202  AVFilterContext *ctx = inlink->dst;
203  SwapRectContext *s = ctx->priv;
204 
205  if (!s->w || !s->h ||
206  !s->x1 || !s->y1 ||
207  !s->x2 || !s->y2)
208  return AVERROR(EINVAL);
209 
210  s->desc = av_pix_fmt_desc_get(inlink->format);
211  av_image_fill_max_pixsteps(s->pixsteps, NULL, s->desc);
212  s->nb_planes = av_pix_fmt_count_planes(inlink->format);
213 
214  s->temp = av_malloc_array(inlink->w, s->pixsteps[0]);
215  if (!s->temp)
216  return AVERROR(ENOMEM);
217 
218  return 0;
219 }
220 
222 {
223  SwapRectContext *s = ctx->priv;
224  av_freep(&s->temp);
225 }
226 
227 static const AVFilterPad inputs[] = {
228  {
229  .name = "default",
230  .type = AVMEDIA_TYPE_VIDEO,
231  .filter_frame = filter_frame,
232  .config_props = config_input,
233  .needs_writable = 1,
234  },
235  { NULL }
236 };
237 
238 static const AVFilterPad outputs[] = {
239  {
240  .name = "default",
241  .type = AVMEDIA_TYPE_VIDEO,
242  },
243  { NULL }
244 };
245 
247  .name = "swaprect",
248  .description = NULL_IF_CONFIG_SMALL("Swap 2 rectangular objects in video."),
249  .priv_size = sizeof(SwapRectContext),
250  .priv_class = &swaprect_class,
252  .uninit = uninit,
253  .inputs = inputs,
254  .outputs = outputs,
256 };
VAR_SAR
@ VAR_SAR
Definition: vf_swaprect.c:77
VAR_H
@ VAR_H
Definition: vf_swaprect.c:77
SwapRectContext::y1
char * y1
Definition: vf_swaprect.c:35
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
opt.h
VAR_VARS_NB
@ VAR_VARS_NB
Definition: vf_swaprect.c:77
FLAGS
#define FLAGS
Definition: vf_swaprect.c:46
SwapRectContext::y2
char * y2
Definition: vf_swaprect.c:36
outputs
static const AVFilterPad outputs[]
Definition: vf_swaprect.c:238
SwapRectContext::temp
uint8_t * temp
Definition: vf_swaprect.c:42
ff_filter_frame
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1075
av_pix_fmt_desc_get
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2549
inlink
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
Definition: filter_design.txt:212
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_swaprect.c:221
SwapRectContext::desc
const AVPixFmtDescriptor * desc
Definition: vf_swaprect.c:41
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:300
pixdesc.h
w
uint8_t w
Definition: llviddspenc.c:38
AVOption
AVOption.
Definition: opt.h:246
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_swaprect.c:59
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:148
video.h
VAR_DAR
@ VAR_DAR
Definition: vf_swaprect.c:77
AVFilterFormats
A list of supported formats for one end of a filter link.
Definition: formats.h:64
formats.h
av_pix_fmt_count_planes
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
Definition: pixdesc.c:2589
SwapRectContext::pixsteps
int pixsteps[4]
Definition: vf_swaprect.c:39
AV_PIX_FMT_FLAG_HWACCEL
#define AV_PIX_FMT_FLAG_HWACCEL
Pixel format is an HW accelerated format.
Definition: pixdesc.h:140
FFMIN3
#define FFMIN3(a, b, c)
Definition: common.h:97
VAR_W
@ VAR_W
Definition: vf_swaprect.c:77
SwapRectContext
Definition: vf_swaprect.c:32
AVFilterPad
A filter pad used for either input or output.
Definition: internal.h:54
av_cold
#define av_cold
Definition: attributes.h:90
ff_set_common_formats
int ff_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
A helper for query_formats() which sets all links to the same list of formats.
Definition: formats.c:605
s
#define s(width, name)
Definition: cbs_vp9.c:257
AV_CEIL_RSHIFT
#define AV_CEIL_RSHIFT(a, b)
Definition: common.h:58
av_q2d
static double av_q2d(AVRational a)
Convert an AVRational to a double.
Definition: rational.h:104
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:275
ctx
AVFormatContext * ctx
Definition: movenc.c:48
SwapRectContext::x2
char * x2
Definition: vf_swaprect.c:36
SwapRectContext::h
char * h
Definition: vf_swaprect.c:34
NAN
#define NAN
Definition: mathematics.h:64
VAR_N
@ VAR_N
Definition: vf_swaprect.c:77
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:67
NULL
#define NULL
Definition: coverity.c:32
src
#define src
Definition: vp8dsp.c:254
ff_add_format
int ff_add_format(AVFilterFormats **avff, int64_t fmt)
Add fmt to the list of media formats contained in *avff.
Definition: formats.c:350
ff_vf_swaprect
AVFilter ff_vf_swaprect
Definition: vf_swaprect.c:246
eval.h
desc
const char * desc
Definition: nvenc.c:79
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:188
av_expr_parse_and_eval
int av_expr_parse_and_eval(double *d, const char *s, const char *const *const_names, const double *const_values, const char *const *func1_names, double(*const *funcs1)(void *, double), const char *const *func2_names, double(*const *funcs2)(void *, double, double), void *opaque, int log_offset, void *log_ctx)
Parse and evaluate an expression.
Definition: eval.c:776
SwapRectContext::w
char * w
Definition: vf_swaprect.c:34
AV_NOPTS_VALUE
#define AV_NOPTS_VALUE
Undefined timestamp value.
Definition: avutil.h:248
AV_PIX_FMT_FLAG_BITSTREAM
#define AV_PIX_FMT_FLAG_BITSTREAM
All values of a component are bit-wise packed end to end.
Definition: pixdesc.h:136
SwapRectContext::x1
char * x1
Definition: vf_swaprect.c:35
internal.h
AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
Definition: avfilter.h:125
in
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(const int16_t *) pi >> 8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(const int32_t *) pi >> 24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(const float *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(const float *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(const float *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(const double *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(const double *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(const double *) pi *(1U<< 31)))) #define SET_CONV_FUNC_GROUP(ofmt, ifmt) static void set_generic_function(AudioConvert *ac) { } void ff_audio_convert_free(AudioConvert **ac) { if(! *ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);} AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, int sample_rate, int apply_map) { AudioConvert *ac;int in_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) return NULL;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);return NULL;} return ac;} 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;} else if(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;else ac->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);return ac;} int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in) { int use_generic=1;int len=in->nb_samples;int p;if(ac->dc) { av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));return ff_convert_dither(ac-> in
Definition: audio_convert.c:326
AVFILTER_DEFINE_CLASS
AVFILTER_DEFINE_CLASS(swaprect)
av_malloc_array
#define av_malloc_array(a, b)
Definition: tableprint_vlc.h:32
uint8_t
uint8_t
Definition: audio_convert.c:194
AVFilterPad::name
const char * name
Pad name.
Definition: internal.h:60
AVFilter
Filter definition.
Definition: avfilter.h:144
ret
ret
Definition: filter_design.txt:187
OFFSET
#define OFFSET(x)
Definition: vf_swaprect.c:45
swaprect_options
static const AVOption swaprect_options[]
Definition: vf_swaprect.c:47
avfilter.h
SwapRectContext::nb_planes
int nb_planes
Definition: vf_swaprect.c:38
VAR_A
@ VAR_A
Definition: vf_swaprect.c:77
av_image_fill_max_pixsteps
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.
Definition: imgutils.c:35
AVFilterContext
An instance of a filter.
Definition: avfilter.h:338
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
var_names
static const char *const var_names[]
Definition: vf_swaprect.c:76
AVPixFmtDescriptor
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition: pixdesc.h:81
inputs
static const AVFilterPad inputs[]
Definition: vf_swaprect.c:227
av_freep
#define av_freep(p)
Definition: tableprint_vlc.h:35
imgutils.h
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:565
h
h
Definition: vp9dsp_template.c:2038
avstring.h
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:227
AV_PIX_FMT_FLAG_PAL
#define AV_PIX_FMT_FLAG_PAL
Pixel format has a palette in data[1], values are indexes in this palette.
Definition: pixdesc.h:132
VAR_POS
@ VAR_POS
Definition: vf_swaprect.c:77
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_swaprect.c:79
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_swaprect.c:200
VAR_T
@ VAR_T
Definition: vf_swaprect.c:77