29 #define CONV_FP(x) ((double) (x)) / (1 << 16)
32 #define CONV_DB(x) (int32_t) ((x) * (1 << 16))
36 double rotation, scale[2];
43 if (scale[0] == 0.0 || scale[1] == 0.0)
46 rotation = atan2(
CONV_FP(matrix[1]) / scale[1],
47 CONV_FP(matrix[0]) / scale[0]) * 180 / M_PI;
54 double radians = angle * M_PI / 180.0f;
55 double c = cos(radians);
56 double s = sin(radians);
58 memset(matrix, 0, 9 *
sizeof(
int32_t));
70 const int flip[] = { 1 - 2 * (!!hflip), 1 - 2 * (!!vflip), 1 };
73 for (i = 0; i < 9; i++)
74 matrix[i] *= flip[i % 3];
void av_display_rotation_set(int32_t matrix[9], double angle)
Initialize a transformation matrix describing a pure rotation by the specified angle (in degrees)...
void av_display_matrix_flip(int32_t matrix[9], int hflip, int vflip)
Flip the input matrix horizontally and/or vertically.
static void flip(AVCodecContext *avctx, AVPicture *picture)
double av_display_rotation_get(const int32_t matrix[9])
The display transformation matrix specifies an affine transformation that should be applied to video ...