Browse Source

opus_pvq: fix crashing on analysis of mono

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
tags/n4.0
Rostislav Pehlivanov 8 years ago
parent
commit
6e0723470b
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      libavcodec/opus_pvq.c

+ 2
- 1
libavcodec/opus_pvq.c View File

@@ -925,7 +925,8 @@ static float pvq_band_cost(CeltPVQ *pvq, CeltFrame *f, OpusRangeCoder *rc, int b


for (i = 0; i < band_size; i++) { for (i = 0; i < band_size; i++) {
err_x += (X[i] - X_orig[i])*(X[i] - X_orig[i]); err_x += (X[i] - X_orig[i])*(X[i] - X_orig[i]);
err_y += (Y[i] - Y_orig[i])*(Y[i] - Y_orig[i]);
if (Y)
err_y += (Y[i] - Y_orig[i])*(Y[i] - Y_orig[i]);
} }


dist = sqrtf(err_x) + sqrtf(err_y); dist = sqrtf(err_x) + sqrtf(err_y);


Loading…
Cancel
Save