aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-09-16 10:31:14 +0000
committerPaul B Mahol <onemda@gmail.com>2013-09-16 12:37:29 +0000
commitfcea6f71ad9d1e8160334d6e8ae197dcb6fcd1fd (patch)
treea3fc9c8e365aa5cda520e1b209a47bbf2a6e4371
parent7283d2bb90ab0b885ab2a53219123be3bca08010 (diff)
downloadffmpeg-fcea6f71ad9d1e8160334d6e8ae197dcb6fcd1fd.tar.gz
avfilter/vf_stereo3d: avoid pointless copy
Signed-off-by: Paul B Mahol <onemda@gmail.com>
-rw-r--r--libavfilter/vf_stereo3d.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/libavfilter/vf_stereo3d.c b/libavfilter/vf_stereo3d.c
index f442d45609..284ee946c3 100644
--- a/libavfilter/vf_stereo3d.c
+++ b/libavfilter/vf_stereo3d.c
@@ -133,7 +133,7 @@ typedef struct Stereo3DContext {
StereoComponent in, out;
int width, height;
int row_step;
- int ana_matrix[3][6];
+ const int *ana_matrix[3];
int nb_planes;
int linesize[4];
int pheight[4];
@@ -389,7 +389,9 @@ static int config_output(AVFilterLink *outlink)
case ANAGLYPH_YB_HALF:
case ANAGLYPH_YB_COLOR:
case ANAGLYPH_YB_DUBOIS:
- memcpy(s->ana_matrix, ana_coeff[s->out.format], sizeof(s->ana_matrix));
+ s->ana_matrix[0] = &ana_coeff[s->out.format][0][0];
+ s->ana_matrix[1] = &ana_coeff[s->out.format][1][0];
+ s->ana_matrix[2] = &ana_coeff[s->out.format][2][0];
break;
case SIDE_BY_SIDE_2_LR:
aspect.den *= 2;
@@ -577,15 +579,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
case ANAGLYPH_YB_HALF:
case ANAGLYPH_YB_COLOR:
case ANAGLYPH_YB_DUBOIS: {
- int i, x, y, il, ir, o;
+ int x, y, il, ir, o;
uint8_t *lsrc = ileft->data[0];
uint8_t *rsrc = iright->data[0];
uint8_t *dst = out->data[0];
int out_width = s->out.width;
- int *ana_matrix[3];
-
- for (i = 0; i < 3; i++)
- ana_matrix[i] = s->ana_matrix[i];
+ const int **ana_matrix = s->ana_matrix;
for (y = 0; y < s->out.height; y++) {
o = out->linesize[0] * y;