Browse Source

swr: move if() block into the only branch where it can be true.

This should make the code a tiny tiny bit faster.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.1
Michael Niedermayer 12 years ago
parent
commit
d53f447130
1 changed files with 5 additions and 4 deletions
  1. +5
    -4
      libswresample/resample_template.c

+ 5
- 4
libswresample/resample_template.c View File

@@ -126,12 +126,13 @@ int RENAME(swri_resample)(ResampleContext *c, DELEM *dst, const DELEM *src, int
} }
*consumed= FFMAX(sample_index, 0); *consumed= FFMAX(sample_index, 0);
index += FFMIN(sample_index, 0) << c->phase_shift; index += FFMIN(sample_index, 0) << c->phase_shift;
}


if(compensation_distance){
compensation_distance -= dst_index;
av_assert1(compensation_distance > 0);
if(compensation_distance){
compensation_distance -= dst_index;
av_assert1(compensation_distance > 0);
}
} }

if(update_ctx){ if(update_ctx){
c->frac= frac; c->frac= frac;
c->index= index; c->index= index;


Loading…
Cancel
Save