aboutsummaryrefslogtreecommitdiffstats
path: root/libswresample/rematrix.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-09-19 08:44:24 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-09-19 08:44:24 +0200
commit1133676f4a015a7d7bd1ad40638faaed4773447b (patch)
tree78e0e64240b10d7fa5eae8f6206e8130c0519eb5 /libswresample/rematrix.c
parenta5f8aace8921bcfcaf1772d4ab227e687b41ae54 (diff)
downloadffmpeg-1133676f4a015a7d7bd1ad40638faaed4773447b.tar.gz
swr: replace sqrt(0.5) by M_SQRT1_2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample/rematrix.c')
-rw-r--r--libswresample/rematrix.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/libswresample/rematrix.c b/libswresample/rematrix.c
index b8c5d45327..fc4b2a7979 100644
--- a/libswresample/rematrix.c
+++ b/libswresample/rematrix.c
@@ -101,15 +101,15 @@ int swr_rematrix_init(SwrContext *s){
if(unaccounted & AV_CH_FRONT_CENTER){
if((s->out_ch_layout & AV_CH_LAYOUT_STEREO) == AV_CH_LAYOUT_STEREO){
- matrix[ FRONT_LEFT][FRONT_CENTER]+= sqrt(0.5);
- matrix[FRONT_RIGHT][FRONT_CENTER]+= sqrt(0.5);
+ matrix[ FRONT_LEFT][FRONT_CENTER]+= M_SQRT1_2;
+ matrix[FRONT_RIGHT][FRONT_CENTER]+= M_SQRT1_2;
}else
av_assert0(0);
}
if(unaccounted & AV_CH_LAYOUT_STEREO){
if(s->out_ch_layout & AV_CH_FRONT_CENTER){
- matrix[FRONT_CENTER][ FRONT_LEFT]+= sqrt(0.5);
- matrix[FRONT_CENTER][FRONT_RIGHT]+= sqrt(0.5);
+ matrix[FRONT_CENTER][ FRONT_LEFT]+= M_SQRT1_2;
+ matrix[FRONT_CENTER][FRONT_RIGHT]+= M_SQRT1_2;
if(s->in_ch_layout & AV_CH_FRONT_CENTER)
matrix[FRONT_CENTER][ FRONT_CENTER] = s->clev*sqrt(2);
}else
@@ -118,27 +118,27 @@ int swr_rematrix_init(SwrContext *s){
if(unaccounted & AV_CH_BACK_CENTER){
if(s->out_ch_layout & AV_CH_BACK_LEFT){
- matrix[ BACK_LEFT][BACK_CENTER]+= sqrt(0.5);
- matrix[BACK_RIGHT][BACK_CENTER]+= sqrt(0.5);
+ matrix[ BACK_LEFT][BACK_CENTER]+= M_SQRT1_2;
+ matrix[BACK_RIGHT][BACK_CENTER]+= M_SQRT1_2;
}else if(s->out_ch_layout & AV_CH_SIDE_LEFT){
- matrix[ SIDE_LEFT][BACK_CENTER]+= sqrt(0.5);
- matrix[SIDE_RIGHT][BACK_CENTER]+= sqrt(0.5);
+ matrix[ SIDE_LEFT][BACK_CENTER]+= M_SQRT1_2;
+ matrix[SIDE_RIGHT][BACK_CENTER]+= M_SQRT1_2;
}else if(s->out_ch_layout & AV_CH_FRONT_LEFT){
- matrix[ FRONT_LEFT][BACK_CENTER]+= s->slev*sqrt(0.5);
- matrix[FRONT_RIGHT][BACK_CENTER]+= s->slev*sqrt(0.5);
+ matrix[ FRONT_LEFT][BACK_CENTER]+= s->slev*M_SQRT1_2;
+ matrix[FRONT_RIGHT][BACK_CENTER]+= s->slev*M_SQRT1_2;
}else if(s->out_ch_layout & AV_CH_FRONT_CENTER){
- matrix[ FRONT_CENTER][BACK_CENTER]+= s->slev*sqrt(0.5);
+ matrix[ FRONT_CENTER][BACK_CENTER]+= s->slev*M_SQRT1_2;
}else
av_assert0(0);
}
if(unaccounted & AV_CH_BACK_LEFT){
if(s->out_ch_layout & AV_CH_BACK_CENTER){
- matrix[BACK_CENTER][ BACK_LEFT]+= sqrt(0.5);
- matrix[BACK_CENTER][BACK_RIGHT]+= sqrt(0.5);
+ matrix[BACK_CENTER][ BACK_LEFT]+= M_SQRT1_2;
+ matrix[BACK_CENTER][BACK_RIGHT]+= M_SQRT1_2;
}else if(s->out_ch_layout & AV_CH_SIDE_LEFT){
if(s->in_ch_layout & AV_CH_SIDE_LEFT){
- matrix[ SIDE_LEFT][ BACK_LEFT]+= sqrt(0.5);
- matrix[SIDE_RIGHT][BACK_RIGHT]+= sqrt(0.5);
+ matrix[ SIDE_LEFT][ BACK_LEFT]+= M_SQRT1_2;
+ matrix[SIDE_RIGHT][BACK_RIGHT]+= M_SQRT1_2;
}else{
matrix[ SIDE_LEFT][ BACK_LEFT]+= 1.0;
matrix[SIDE_RIGHT][BACK_RIGHT]+= 1.0;
@@ -147,8 +147,8 @@ int swr_rematrix_init(SwrContext *s){
matrix[ FRONT_LEFT][ BACK_LEFT]+= s->slev;
matrix[FRONT_RIGHT][BACK_RIGHT]+= s->slev;
}else if(s->out_ch_layout & AV_CH_FRONT_CENTER){
- matrix[ FRONT_CENTER][BACK_LEFT ]+= s->slev*sqrt(0.5);
- matrix[ FRONT_CENTER][BACK_RIGHT]+= s->slev*sqrt(0.5);
+ matrix[ FRONT_CENTER][BACK_LEFT ]+= s->slev*M_SQRT1_2;
+ matrix[ FRONT_CENTER][BACK_RIGHT]+= s->slev*M_SQRT1_2;
}else
av_assert0(0);
}
@@ -158,14 +158,14 @@ int swr_rematrix_init(SwrContext *s){
matrix[ BACK_LEFT][ SIDE_LEFT]+= 1.0;
matrix[BACK_RIGHT][SIDE_RIGHT]+= 1.0;
}else if(s->out_ch_layout & AV_CH_BACK_CENTER){
- matrix[BACK_CENTER][ SIDE_LEFT]+= sqrt(0.5);
- matrix[BACK_CENTER][SIDE_RIGHT]+= sqrt(0.5);
+ matrix[BACK_CENTER][ SIDE_LEFT]+= M_SQRT1_2;
+ matrix[BACK_CENTER][SIDE_RIGHT]+= M_SQRT1_2;
}else if(s->out_ch_layout & AV_CH_FRONT_LEFT){
matrix[ FRONT_LEFT][ SIDE_LEFT]+= s->slev;
matrix[FRONT_RIGHT][SIDE_RIGHT]+= s->slev;
}else if(s->out_ch_layout & AV_CH_FRONT_CENTER){
- matrix[ FRONT_CENTER][SIDE_LEFT ]+= s->slev*sqrt(0.5);
- matrix[ FRONT_CENTER][SIDE_RIGHT]+= s->slev*sqrt(0.5);
+ matrix[ FRONT_CENTER][SIDE_LEFT ]+= s->slev*M_SQRT1_2;
+ matrix[ FRONT_CENTER][SIDE_RIGHT]+= s->slev*M_SQRT1_2;
}else
av_assert0(0);
}
@@ -175,8 +175,8 @@ int swr_rematrix_init(SwrContext *s){
matrix[ FRONT_LEFT][ FRONT_LEFT_OF_CENTER]+= 1.0;
matrix[FRONT_RIGHT][FRONT_RIGHT_OF_CENTER]+= 1.0;
}else if(s->out_ch_layout & AV_CH_FRONT_CENTER){
- matrix[ FRONT_CENTER][ FRONT_LEFT_OF_CENTER]+= sqrt(0.5);
- matrix[ FRONT_CENTER][FRONT_RIGHT_OF_CENTER]+= sqrt(0.5);
+ matrix[ FRONT_CENTER][ FRONT_LEFT_OF_CENTER]+= M_SQRT1_2;
+ matrix[ FRONT_CENTER][FRONT_RIGHT_OF_CENTER]+= M_SQRT1_2;
}else
av_assert0(0);
}