aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Vignali <martin.vignali@gmail.com>2017-10-28 17:12:58 +0200
committerMartin Vignali <martin.vignali@gmail.com>2017-11-07 00:51:17 +0100
commit9c714731895aab109151a36bf21838f7c4e86445 (patch)
tree7688f9ca2dbb1e47cf99f84028577b93c4acec69
parent97ac8a47ddc81cb57b7a702e2a301570faa1f11b (diff)
downloadffmpeg-9c714731895aab109151a36bf21838f7c4e86445.tar.gz
libavcodec/utvideo : simplify decode_plane
the func is only call with step = 1 no need to pass it in the func
-rw-r--r--libavcodec/utvideodec.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c
index 26c3f8a506..83dbae99b1 100644
--- a/libavcodec/utvideodec.c
+++ b/libavcodec/utvideodec.c
@@ -126,7 +126,7 @@ static int build_huff(const uint8_t *src, VLC *vlc, int *fsym)
}
static int decode_plane10(UtvideoContext *c, int plane_no,
- uint16_t *dst, int step, ptrdiff_t stride,
+ uint16_t *dst, ptrdiff_t stride,
int width, int height,
const uint8_t *src, const uint8_t *huff,
int use_pred)
@@ -152,7 +152,7 @@ static int decode_plane10(UtvideoContext *c, int plane_no,
prev = 0x200;
for (j = sstart; j < send; j++) {
- for (i = 0; i < width * step; i += step) {
+ for (i = 0; i < width; i++) {
pix = fsym;
if (use_pred) {
prev += pix;
@@ -195,8 +195,7 @@ static int decode_plane10(UtvideoContext *c, int plane_no,
prev = 0x200;
for (j = sstart; j < send; j++) {
- int ws = width * step;
- for (i = 0; i < ws; i += step) {
+ for (i = 0; i < width; i++) {
pix = get_vlc2(&gb, vlc.table, VLC_BITS, 3);
if (pix < 0) {
av_log(c->avctx, AV_LOG_ERROR, "Decoding error\n");
@@ -240,7 +239,7 @@ static int compute_cmask(int plane_no, int interlaced, enum AVPixelFormat pix_fm
}
static int decode_plane(UtvideoContext *c, int plane_no,
- uint8_t *dst, int step, ptrdiff_t stride,
+ uint8_t *dst, ptrdiff_t stride,
int width, int height,
const uint8_t *src, int use_pred)
{
@@ -266,7 +265,7 @@ static int decode_plane(UtvideoContext *c, int plane_no,
prev = 0x80;
for (j = sstart; j < send; j++) {
- for (i = 0; i < width * step; i += step) {
+ for (i = 0; i < width; i++) {
pix = fsym;
if (use_pred) {
prev += pix;
@@ -310,8 +309,7 @@ static int decode_plane(UtvideoContext *c, int plane_no,
prev = 0x80;
for (j = sstart; j < send; j++) {
- int ws = width * step;
- for (i = 0; i < ws; i += step) {
+ for (i = 0; i < width; i++) {
pix = get_vlc2(&gb, vlc.table, VLC_BITS, 3);
if (pix < 0) {
av_log(c->avctx, AV_LOG_ERROR, "Decoding error\n");
@@ -634,7 +632,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
case AV_PIX_FMT_GBRP:
case AV_PIX_FMT_GBRAP:
for (i = 0; i < c->planes; i++) {
- ret = decode_plane(c, i, frame.f->data[i], 1,
+ ret = decode_plane(c, i, frame.f->data[i],
frame.f->linesize[i], avctx->width,
avctx->height, plane_start[i],
c->frame_pred == PRED_LEFT);
@@ -671,7 +669,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
case AV_PIX_FMT_GBRAP10:
case AV_PIX_FMT_GBRP10:
for (i = 0; i < c->planes; i++) {
- ret = decode_plane10(c, i, (uint16_t *)frame.f->data[i], 1,
+ ret = decode_plane10(c, i, (uint16_t *)frame.f->data[i],
frame.f->linesize[i] / 2, avctx->width,
avctx->height, plane_start[i],
plane_start[i + 1] - 1024,
@@ -685,7 +683,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
break;
case AV_PIX_FMT_YUV420P:
for (i = 0; i < 3; i++) {
- ret = decode_plane(c, i, frame.f->data[i], 1, frame.f->linesize[i],
+ ret = decode_plane(c, i, frame.f->data[i], frame.f->linesize[i],
avctx->width >> !!i, avctx->height >> !!i,
plane_start[i], c->frame_pred == PRED_LEFT);
if (ret)
@@ -717,7 +715,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
break;
case AV_PIX_FMT_YUV422P:
for (i = 0; i < 3; i++) {
- ret = decode_plane(c, i, frame.f->data[i], 1, frame.f->linesize[i],
+ ret = decode_plane(c, i, frame.f->data[i], frame.f->linesize[i],
avctx->width >> !!i, avctx->height,
plane_start[i], c->frame_pred == PRED_LEFT);
if (ret)
@@ -747,7 +745,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
break;
case AV_PIX_FMT_YUV444P:
for (i = 0; i < 3; i++) {
- ret = decode_plane(c, i, frame.f->data[i], 1, frame.f->linesize[i],
+ ret = decode_plane(c, i, frame.f->data[i], frame.f->linesize[i],
avctx->width, avctx->height,
plane_start[i], c->frame_pred == PRED_LEFT);
if (ret)
@@ -777,7 +775,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
break;
case AV_PIX_FMT_YUV422P10:
for (i = 0; i < 3; i++) {
- ret = decode_plane10(c, i, (uint16_t *)frame.f->data[i], 1, frame.f->linesize[i] / 2,
+ ret = decode_plane10(c, i, (uint16_t *)frame.f->data[i], frame.f->linesize[i] / 2,
avctx->width >> !!i, avctx->height,
plane_start[i], plane_start[i + 1] - 1024, c->frame_pred == PRED_LEFT);
if (ret)