diff options
author | Paul B Mahol <onemda@gmail.com> | 2020-03-03 14:41:30 +0300 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2020-03-03 14:41:30 +0300 |
commit | 5c7b6aadb590df61af4a526fe5394d39e813f256 (patch) | |
tree | 99a87db5755a8c0fc7e36e2cac2bf0a99a8864d9 /libavfilter | |
parent | 580d68f90e4cd363ad75d187a7b42f7951733f79 (diff) |
avfilter/vf_v360: simplify some unnecessary indirections
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_v360.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c index 05c558d97d..ae94354212 100644 --- a/libavfilter/vf_v360.c +++ b/libavfilter/vf_v360.c @@ -1265,8 +1265,8 @@ static int cube3x2_to_xyz(const V360Context *s, int i, int j, int width, int height, float *vec) { - const float scalew = s->fout_pad > 0 ? 1.f - s->fout_pad / (s->out_width / 3.f) : 1.f - s->out_pad; - const float scaleh = s->fout_pad > 0 ? 1.f - s->fout_pad / (s->out_height / 2.f) : 1.f - s->out_pad; + const float scalew = s->fout_pad > 0 ? 1.f - s->fout_pad / (width / 3.f) : 1.f - s->out_pad; + const float scaleh = s->fout_pad > 0 ? 1.f - s->fout_pad / (height / 2.f) : 1.f - s->out_pad; const float ew = width / 3.f; const float eh = height / 2.f; @@ -1304,8 +1304,8 @@ static int xyz_to_cube3x2(const V360Context *s, const float *vec, int width, int height, int16_t us[4][4], int16_t vs[4][4], float *du, float *dv) { - const float scalew = s->fin_pad > 0 ? 1.f - s->fin_pad / (s->in_width / 3.f) : 1.f - s->in_pad; - const float scaleh = s->fin_pad > 0 ? 1.f - s->fin_pad / (s->in_height / 2.f) : 1.f - s->in_pad; + const float scalew = s->fin_pad > 0 ? 1.f - s->fin_pad / (width / 3.f) : 1.f - s->in_pad; + const float scaleh = s->fin_pad > 0 ? 1.f - s->fin_pad / (height / 2.f) : 1.f - s->in_pad; const float ew = width / 3.f; const float eh = height / 2.f; float uf, vf; @@ -1393,8 +1393,8 @@ static int cube1x6_to_xyz(const V360Context *s, int i, int j, int width, int height, float *vec) { - const float scalew = s->fout_pad > 0 ? 1.f - (float)(s->fout_pad) / s->out_width : 1.f - s->out_pad; - const float scaleh = s->fout_pad > 0 ? 1.f - s->fout_pad / (s->out_height / 6.f) : 1.f - s->out_pad; + const float scalew = s->fout_pad > 0 ? 1.f - (float)(s->fout_pad) / width : 1.f - s->out_pad; + const float scaleh = s->fout_pad > 0 ? 1.f - s->fout_pad / (height / 6.f) : 1.f - s->out_pad; const float ew = width; const float eh = height / 6.f; @@ -1426,8 +1426,8 @@ static int cube6x1_to_xyz(const V360Context *s, int i, int j, int width, int height, float *vec) { - const float scalew = s->fout_pad > 0 ? 1.f - s->fout_pad / (s->out_width / 6.f) : 1.f - s->out_pad; - const float scaleh = s->fout_pad > 0 ? 1.f - (float)(s->fout_pad) / s->out_height : 1.f - s->out_pad; + const float scalew = s->fout_pad > 0 ? 1.f - s->fout_pad / (width / 6.f) : 1.f - s->out_pad; + const float scaleh = s->fout_pad > 0 ? 1.f - (float)(s->fout_pad) / height : 1.f - s->out_pad; const float ew = width / 6.f; const float eh = height; @@ -1461,8 +1461,8 @@ static int xyz_to_cube1x6(const V360Context *s, const float *vec, int width, int height, int16_t us[4][4], int16_t vs[4][4], float *du, float *dv) { - const float scalew = s->fin_pad > 0 ? 1.f - (float)(s->fin_pad) / s->in_width : 1.f - s->in_pad; - const float scaleh = s->fin_pad > 0 ? 1.f - s->fin_pad / (s->in_height / 6.f) : 1.f - s->in_pad; + const float scalew = s->fin_pad > 0 ? 1.f - (float)(s->fin_pad) / width : 1.f - s->in_pad; + const float scaleh = s->fin_pad > 0 ? 1.f - s->fin_pad / (height / 6.f) : 1.f - s->in_pad; const float eh = height / 6.f; const int ewi = width; float uf, vf; @@ -1541,8 +1541,8 @@ static int xyz_to_cube6x1(const V360Context *s, const float *vec, int width, int height, int16_t us[4][4], int16_t vs[4][4], float *du, float *dv) { - const float scalew = s->fin_pad > 0 ? 1.f - s->fin_pad / (s->in_width / 6.f) : 1.f - s->in_pad; - const float scaleh = s->fin_pad > 0 ? 1.f - (float)(s->fin_pad) / s->in_height : 1.f - s->in_pad; + const float scalew = s->fin_pad > 0 ? 1.f - s->fin_pad / (width / 6.f) : 1.f - s->in_pad; + const float scaleh = s->fin_pad > 0 ? 1.f - (float)(s->fin_pad) / height : 1.f - s->in_pad; const float ew = width / 6.f; const int ehi = height; float uf, vf; @@ -4061,12 +4061,6 @@ static int config_output(AVFilterLink *outlink) set_dimensions(s->pr_width, s->pr_height, w, h, desc); - s->out_width = s->pr_width[0]; - s->out_height = s->pr_height[0]; - - if (s->out_transpose) - FFSWAP(int, s->out_width, s->out_height); - switch (s->out_stereo) { case STEREO_2D: out_offset_w = out_offset_h = 0; |