summaryrefslogtreecommitdiff
path: root/lib/rbcodec/codecs/mp3_enc.c
diff options
context:
space:
mode:
authorRafaël Carré <funman@videolan.org>2012-05-06 23:34:56 -0400
committerRafaël Carré <funman@videolan.org>2012-05-06 23:34:56 -0400
commit06c8ab852b7be4b2788c7d3bfc41e1def3c09503 (patch)
tree939ff4715f4f8a147f22684e6cfc90a8337d70df /lib/rbcodec/codecs/mp3_enc.c
parent65bb8e4452575164a36fbd503bb3d23f7061b9d1 (diff)
Don't use function in a function
It is not supported by clang
Diffstat (limited to 'lib/rbcodec/codecs/mp3_enc.c')
-rw-r--r--lib/rbcodec/codecs/mp3_enc.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/lib/rbcodec/codecs/mp3_enc.c b/lib/rbcodec/codecs/mp3_enc.c
index 2f5528f74c..f765e6bba6 100644
--- a/lib/rbcodec/codecs/mp3_enc.c
+++ b/lib/rbcodec/codecs/mp3_enc.c
@@ -2082,6 +2082,34 @@ static bool init_mp3_encoder_engine(int sample_rate,
return true;
}
+static inline void to_mono(uint16_t **samp)
+{
+ int16_t l = **samp;
+ int16_t r = *(*samp+1);
+ int32_t m;
+
+ switch(cfg.rec_mono_mode)
+ {
+ case 1:
+ /* mono = L */
+ m = l;
+ break;
+ case 2:
+ /* mono = R */
+ m = r;
+ break;
+ case 0:
+ default:
+ /* mono = (L+R)/2 */
+ m = l + r + err;
+ err = m & 1;
+ m >>= 1;
+ break;
+ }
+ *(*samp)++ = (uint16_t)m;
+ *(*samp)++ = (uint16_t)m;
+} /* to_mono */
+
STATICIRAM void to_mono_mm(void) ICODE_ATTR;
STATICIRAM void to_mono_mm(void)
{
@@ -2091,34 +2119,6 @@ STATICIRAM void to_mono_mm(void)
uint16_t *samp = &mfbuf[2*512];
uint16_t *samp_end = samp + 2*samp_per_frame;
- inline void to_mono(uint16_t **samp)
- {
- int16_t l = **samp;
- int16_t r = *(*samp+1);
- int32_t m;
-
- switch(cfg.rec_mono_mode)
- {
- case 1:
- /* mono = L */
- m = l;
- break;
- case 2:
- /* mono = R */
- m = r;
- break;
- case 0:
- default:
- /* mono = (L+R)/2 */
- m = l + r + err;
- err = m & 1;
- m >>= 1;
- break;
- }
- *(*samp)++ = (uint16_t)m;
- *(*samp)++ = (uint16_t)m;
- } /* to_mono */
-
do
{
to_mono(&samp);