[FFmpeg-cvslog] alac: factor out output_size check in predictor_decompress_fir_adapt()

Justin Ruggles git at videolan.org
Thu Jul 19 23:35:53 CEST 2012


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Mon Jul  9 13:01:32 2012 -0400| [9a6c528e08c42f43216fed9d6abd9e545db88d13] | committer: Justin Ruggles

alac: factor out output_size check in predictor_decompress_fir_adapt()

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9a6c528e08c42f43216fed9d6abd9e545db88d13
---

 libavcodec/alac.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index 42dfdad..474531b 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -173,10 +173,10 @@ static void predictor_decompress_fir_adapt(int32_t *error_buffer,
     /* first sample always copies */
     *buffer_out = *error_buffer;
 
-    if (!predictor_coef_num) {
-        if (output_size <= 1)
-            return;
+    if (output_size <= 1)
+        return;
 
+    if (!predictor_coef_num) {
         memcpy(&buffer_out[1], &error_buffer[1],
                (output_size - 1) * sizeof(*buffer_out));
         return;
@@ -184,8 +184,6 @@ static void predictor_decompress_fir_adapt(int32_t *error_buffer,
 
     if (predictor_coef_num == 31) {
         /* simple 1st-order prediction */
-        if (output_size <= 1)
-            return;
         for (i = 1; i < output_size; i++) {
             buffer_out[i] = sign_extend(buffer_out[i - 1] + error_buffer[i],
                                         readsamplesize);



More information about the ffmpeg-cvslog mailing list