aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/flacenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-19 12:11:27 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-05-19 12:11:27 +0200
commitd3dcd2881247a5249d555f25f3f163a441c46237 (patch)
tree2e9a81751f0c9ccbb5a725dfaabadd425734c516 /libavcodec/flacenc.c
parentd0ac2f59aa36709e14e399ada566b5a838f98ef0 (diff)
downloadffmpeg-d3dcd2881247a5249d555f25f3f163a441c46237.tar.gz
avcodec/flacenc: Do not copy unused udata array -> 5x faster calc_rice_params()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/flacenc.c')
-rw-r--r--libavcodec/flacenc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c
index b6dc4d5c07..e7f074b570 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;