summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-07-12 13:57:48 +0200
committerAnton Khirnov <anton@khirnov.net>2016-07-25 13:57:02 +0200
commit4d6e35f434b6eca7a3384ff517c57cc8097395a3 (patch)
tree2f5a2a624ff545f7b30f84c70dd920f2a7fea2bd
parent9a8f36cfeb9d3fae5525d3d370e15201c1cbdd15 (diff)
cfhd: drop some variables from the context
They are only used locally in one function.
-rw-r--r--libavcodec/cfhd.c9
-rw-r--r--libavcodec/cfhd.h3
2 files changed, 5 insertions, 7 deletions
diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
index f9ab950cfb..febb0c2b6b 100644
--- a/libavcodec/cfhd.c
+++ b/libavcodec/cfhd.c
@@ -173,6 +173,7 @@ static void free_buffers(CFHDContext *s)
static int alloc_buffers(CFHDContext *s)
{
int i, j, ret, planes;
+ int chroma_x_shift, chroma_y_shift;
unsigned k;
if ((ret = ff_set_dimensions(s->avctx, s->coded_width, s->coded_height)) < 0)
@@ -183,15 +184,15 @@ static int alloc_buffers(CFHDContext *s)
s->avctx->pix_fmt = s->coded_format;
if ((ret = av_pix_fmt_get_chroma_sub_sample(s->coded_format,
- &s->chroma_x_shift,
- &s->chroma_y_shift)) < 0)
+ &chroma_x_shift,
+ &chroma_y_shift)) < 0)
return ret;
planes = av_pix_fmt_count_planes(s->coded_format);
for (i = 0; i < planes; i++) {
int w8, h8, w4, h4, w2, h2;
- int width = i ? s->coded_width >> s->chroma_x_shift : s->coded_width;
- int height = i ? s->coded_height >> s->chroma_y_shift : s->coded_height;
+ int width = i ? s->coded_width >> chroma_x_shift : s->coded_width;
+ int height = i ? s->coded_height >> chroma_y_shift : s->coded_height;
ptrdiff_t stride = FFALIGN(width / 8, 8) * 8;
height = FFALIGN(height / 8, 2) * 8;
s->plane[i].width = width;
diff --git a/libavcodec/cfhd.h b/libavcodec/cfhd.h
index 05d251132c..cae571a681 100644
--- a/libavcodec/cfhd.h
+++ b/libavcodec/cfhd.h
@@ -75,9 +75,6 @@ typedef struct CFHDContext {
GetBitContext gb;
- int chroma_x_shift;
- int chroma_y_shift;
-
int coded_width;
int coded_height;
int cropped_height;