[FFmpeg-cvslog] avcodec/flacenc: Do not copy unused udata array -> 5x faster calc_rice_params()
Michael Niedermayer
git at videolan.org
Tue May 19 12:20:10 CEST 2015
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue May 19 12:11:27 2015 +0200| [d3dcd2881247a5249d555f25f3f163a441c46237] | committer: Michael Niedermayer
avcodec/flacenc: Do not copy unused udata array -> 5x faster calc_rice_params()
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d3dcd2881247a5249d555f25f3f163a441c46237
---
libavcodec/flacenc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c
index b6dc4d5..e7f074b 100644
--- a/libavcodec/flacenc.c
+++ b/libavcodec/flacenc.c
@@ -667,7 +667,9 @@ static uint64_t calc_rice_params(RiceContext *rc, int pmin, int pmax,
bits[i] = calc_optimal_rice_params(&tmp_rc, i, sums, n, pred_order);
if (bits[i] < bits[opt_porder]) {
opt_porder = i;
- *rc = tmp_rc;
+ rc->coding_mode = tmp_rc.coding_mode;
+ rc->porder = tmp_rc.porder;
+ memcpy(rc->params, tmp_rc.params, sizeof(rc->params));
}
if (i == pmin)
break;
More information about the ffmpeg-cvslog
mailing list