Go to the documentation of this file.
29 #define CONV_FP(x) ((double) (x)) / (1 << 16)
32 #define CONV_DB(x) (int32_t) ((x) * (1 << 16))
36 double rotation, scale[2];
41 if (scale[0] == 0.0 || scale[1] == 0.0)
44 rotation = atan2(
CONV_FP(matrix[1]) / scale[1],
52 double radians = -angle *
M_PI / 180.0f;
53 double c = cos(radians);
54 double s = sin(radians);
56 memset(matrix, 0, 9 *
sizeof(
int32_t));
68 const int flip[] = { 1 - 2 * (!!hflip), 1 - 2 * (!!vflip), 1 };
71 for (
i = 0;
i < 9;
i++)
void av_display_matrix_flip(int32_t matrix[9], int hflip, int vflip)
Flip the input matrix horizontally and/or vertically.
void av_display_rotation_set(int32_t matrix[9], double angle)
Initialize a transformation matrix describing a pure counterclockwise rotation by the specified angle...
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
static void flip(AVCodecContext *avctx, AVFrame *frame)
static av_const double hypot(double x, double y)
#define i(width, name, range_min, range_max)
double av_display_rotation_get(const int32_t matrix[9])
Extract the rotation component of the transformation matrix.