Commit 0d439fbe authored by Diego Biurrun's avatar Diego Biurrun
Browse files

dsputil: Split off HuffYUV decoding bits into their own context

Also shorten HuffYUV context member names to avoid clutter.
parent 888dcd86
......@@ -1541,6 +1541,7 @@ CONFIG_EXTRA="
h264qpel
hpeldsp
huffman
huffyuvdsp
intrax8
lgplv3
lpc
......@@ -1771,7 +1772,7 @@ h263p_encoder_select="h263_encoder"
h264_decoder_select="cabac golomb h264chroma h264dsp h264pred h264qpel videodsp"
h264_decoder_suggest="error_resilience"
hevc_decoder_select="cabac dsputil golomb videodsp"
huffyuv_decoder_select="dsputil"
huffyuv_decoder_select="dsputil huffyuvdsp"
huffyuv_encoder_select="dsputil huffman"
iac_decoder_select="imc_decoder"
imc_decoder_select="dsputil fft mdct sinewin"
......@@ -1780,7 +1781,7 @@ interplay_video_decoder_select="hpeldsp"
jpegls_decoder_select="golomb mjpeg_decoder"
jpegls_encoder_select="golomb"
jv_decoder_select="dsputil"
lagarith_decoder_select="dsputil"
lagarith_decoder_select="huffyuvdsp"
ljpeg_encoder_select="aandcttables mpegvideoenc"
loco_decoder_select="golomb"
mdec_decoder_select="dsputil error_resilience mpegvideo"
......@@ -1857,7 +1858,7 @@ tscc_decoder_deps="zlib"
twinvq_decoder_select="mdct lsp sinewin"
utvideo_decoder_select="dsputil"
utvideo_encoder_select="dsputil huffman"
vble_decoder_select="dsputil"
vble_decoder_select="huffyuvdsp"
vc1_decoder_select="error_resilience h263_decoder h264chroma h264qpel intrax8"
vc1image_decoder_select="vc1_decoder"
vorbis_decoder_select="mdct"
......
......@@ -46,6 +46,7 @@ OBJS-$(CONFIG_H264PRED) += h264pred.o
OBJS-$(CONFIG_H264QPEL) += h264qpel.o
OBJS-$(CONFIG_HPELDSP) += hpeldsp.o
OBJS-$(CONFIG_HUFFMAN) += huffman.o
OBJS-$(CONFIG_HUFFYUVDSP) += huffyuvdsp.o
OBJS-$(CONFIG_INTRAX8) += intrax8.o intrax8dsp.o
OBJS-$(CONFIG_LIBXVID) += libxvid_rc.o
OBJS-$(CONFIG_LPC) += lpc.o
......
......@@ -1663,19 +1663,6 @@ void ff_set_cmp(DSPContext *c, me_cmp_func *cmp, int type)
}
}
static void add_bytes_c(uint8_t *dst, uint8_t *src, int w)
{
long i;
for (i = 0; i <= w - (int) sizeof(long); i += sizeof(long)) {
long a = *(long *) (src + i);
long b = *(long *) (dst + i);
*(long *) (dst + i) = ((a & pb_7f) + (b & pb_7f)) ^ ((a ^ b) & pb_80);
}
for (; i < w; i++)
dst[i + 0] += src[i + 0];
}
static void diff_bytes_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w)
{
long i;
......@@ -1704,26 +1691,6 @@ static void diff_bytes_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w)
dst[i + 0] = src1[i + 0] - src2[i + 0];
}
static void add_hfyu_median_prediction_c(uint8_t *dst, const uint8_t *src1,
const uint8_t *diff, int w,
int *left, int *left_top)
{
int i;
uint8_t l, lt;
l = *left;
lt = *left_top;
for (i = 0; i < w; i++) {
l = mid_pred(l, src1[i], (l + src1[i] - lt) & 0xFF) + diff[i];
lt = src1[i];
dst[i] = l;
}
*left = l;
*left_top = lt;
}
static void sub_hfyu_median_prediction_c(uint8_t *dst, const uint8_t *src1,
const uint8_t *src2, int w,
int *left, int *left_top)
......@@ -1745,66 +1712,6 @@ static void sub_hfyu_median_prediction_c(uint8_t *dst, const uint8_t *src1,
*left_top = lt;
}
static int add_hfyu_left_prediction_c(uint8_t *dst, const uint8_t *src,
int w, int acc)
{
int i;
for (i = 0; i < w - 1; i++) {
acc += src[i];
dst[i] = acc;
i++;
acc += src[i];
dst[i] = acc;
}
for (; i < w; i++) {
acc += src[i];
dst[i] = acc;
}
return acc;
}
#if HAVE_BIGENDIAN
#define B 3
#define G 2
#define R 1
#define A 0
#else
#define B 0
#define G 1
#define R 2
#define A 3
#endif
static void add_hfyu_left_prediction_bgr32_c(uint8_t *dst, const uint8_t *src,
int w, int *red, int *green,
int *blue, int *alpha)
{
int i, r = *red, g = *green, b = *blue, a = *alpha;
for (i = 0; i < w; i++) {
b += src[4 * i + B];
g += src[4 * i + G];
r += src[4 * i + R];
a += src[4 * i + A];
dst[4 * i + B] = b;
dst[4 * i + G] = g;
dst[4 * i + R] = r;
dst[4 * i + A] = a;
}
*red = r;
*green = g;
*blue = b;
*alpha = a;
}
#undef B
#undef G
#undef R
#undef A
#define BUTTERFLY2(o1, o2, i1, i2) \
o1 = (i1) + (i2); \
o2 = (i1) - (i2);
......@@ -2578,11 +2485,6 @@ av_cold void ff_dsputil_init(DSPContext *c, AVCodecContext *avctx)
c->ssd_int8_vs_int16 = ssd_int8_vs_int16_c;
c->add_bytes = add_bytes_c;
c->add_hfyu_median_prediction = add_hfyu_median_prediction_c;
c->add_hfyu_left_prediction = add_hfyu_left_prediction_c;
c->add_hfyu_left_prediction_bgr32 = add_hfyu_left_prediction_bgr32_c;
c->diff_bytes = diff_bytes_c;
c->sub_hfyu_median_prediction = sub_hfyu_median_prediction_c;
......
......@@ -186,9 +186,6 @@ typedef struct DSPContext {
me_cmp_func pix_abs[2][4];
/* HuffYUV specific */
void (*add_bytes)(uint8_t *dst /* align 16 */,
uint8_t *src /* align 16 */,
int w);
void (*diff_bytes)(uint8_t *dst /* align 16 */,
uint8_t *src1 /* align 16 */,
uint8_t *src2 /* align 1 */,
......@@ -200,14 +197,7 @@ typedef struct DSPContext {
void (*sub_hfyu_median_prediction)(uint8_t *dst, const uint8_t *src1,
const uint8_t *src2, int w,
int *left, int *left_top);
void (*add_hfyu_median_prediction)(uint8_t *dst, const uint8_t *top,
const uint8_t *diff, int w,
int *left, int *left_top);
int (*add_hfyu_left_prediction)(uint8_t *dst, const uint8_t *src,
int w, int left);
void (*add_hfyu_left_prediction_bgr32)(uint8_t *dst, const uint8_t *src,
int w, int *red, int *green,
int *blue, int *alpha);
void (*bswap_buf)(uint32_t *dst, const uint32_t *src, int w);
void (*bswap16_buf)(uint16_t *dst, const uint16_t *src, int len);
......
......@@ -33,6 +33,7 @@
#include "libavutil/mem.h"
#include "avcodec.h"
#include "dsputil.h"
#include "huffyuv.h"
int ff_huffyuv_generate_bits_table(uint32_t *dst, const uint8_t *len_table)
......
......@@ -34,6 +34,7 @@
#include "avcodec.h"
#include "dsputil.h"
#include "get_bits.h"
#include "huffyuvdsp.h"
#include "put_bits.h"
#define VLC_BITS 11
......@@ -81,6 +82,7 @@ typedef struct HYuvContext {
uint8_t *bitstream_buffer;
unsigned int bitstream_buffer_size;
DSPContext dsp;
HuffYUVDSPContext hdsp;
} HYuvContext;
void ff_huffyuv_common_init(AVCodecContext *s);
......
......@@ -31,6 +31,7 @@
#include "avcodec.h"
#include "get_bits.h"
#include "huffyuv.h"
#include "huffyuvdsp.h"
#include "thread.h"
#define classic_shift_luma_table_size 42
......@@ -239,6 +240,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
HYuvContext *s = avctx->priv_data;
ff_huffyuv_common_init(avctx);
ff_huffyuvdsp_init(&s->hdsp);
memset(s->vlc, 0, 3 * sizeof(VLC));
s->interlaced = s->height > 288;
......@@ -542,10 +544,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
case LEFT:
case PLANE:
decode_422_bitstream(s, width-2);
lefty = s->dsp.add_hfyu_left_prediction(p->data[0] + 2, s->temp[0], width-2, lefty);
lefty = s->hdsp.add_hfyu_left_pred(p->data[0] + 2, s->temp[0], width - 2, lefty);
if (!(s->flags&CODEC_FLAG_GRAY)) {
leftu = s->dsp.add_hfyu_left_prediction(p->data[1] + 1, s->temp[1], width2 - 1, leftu);
leftv = s->dsp.add_hfyu_left_prediction(p->data[2] + 1, s->temp[2], width2 - 1, leftv);
leftu = s->hdsp.add_hfyu_left_pred(p->data[1] + 1, s->temp[1], width2 - 1, leftu);
leftv = s->hdsp.add_hfyu_left_pred(p->data[2] + 1, s->temp[2], width2 - 1, leftv);
}
for (cy = y = 1; y < s->height; y++, cy++) {
......@@ -556,10 +558,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
ydst = p->data[0] + p->linesize[0] * y;
lefty = s->dsp.add_hfyu_left_prediction(ydst, s->temp[0], width, lefty);
lefty = s->hdsp.add_hfyu_left_pred(ydst, s->temp[0], width, lefty);
if (s->predictor == PLANE) {
if (y > s->interlaced)
s->dsp.add_bytes(ydst, ydst - fake_ystride, width);
s->hdsp.add_bytes(ydst, ydst - fake_ystride, width);
}
y++;
if (y >= s->height) break;
......@@ -572,17 +574,17 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
vdst = p->data[2] + p->linesize[2]*cy;
decode_422_bitstream(s, width);
lefty = s->dsp.add_hfyu_left_prediction(ydst, s->temp[0], width, lefty);
lefty = s->hdsp.add_hfyu_left_pred(ydst, s->temp[0], width, lefty);
if (!(s->flags & CODEC_FLAG_GRAY)) {
leftu= s->dsp.add_hfyu_left_prediction(udst, s->temp[1], width2, leftu);
leftv= s->dsp.add_hfyu_left_prediction(vdst, s->temp[2], width2, leftv);
leftu = s->hdsp.add_hfyu_left_pred(udst, s->temp[1], width2, leftu);
leftv = s->hdsp.add_hfyu_left_pred(vdst, s->temp[2], width2, leftv);
}
if (s->predictor == PLANE) {
if (cy > s->interlaced) {
s->dsp.add_bytes(ydst, ydst - fake_ystride, width);
s->hdsp.add_bytes(ydst, ydst - fake_ystride, width);
if (!(s->flags & CODEC_FLAG_GRAY)) {
s->dsp.add_bytes(udst, udst - fake_ustride, width2);
s->dsp.add_bytes(vdst, vdst - fake_vstride, width2);
s->hdsp.add_bytes(udst, udst - fake_ustride, width2);
s->hdsp.add_bytes(vdst, vdst - fake_vstride, width2);
}
}
}
......@@ -593,10 +595,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
case MEDIAN:
/* first line except first 2 pixels is left predicted */
decode_422_bitstream(s, width - 2);
lefty= s->dsp.add_hfyu_left_prediction(p->data[0] + 2, s->temp[0], width - 2, lefty);
lefty = s->hdsp.add_hfyu_left_pred(p->data[0] + 2, s->temp[0], width - 2, lefty);
if (!(s->flags & CODEC_FLAG_GRAY)) {
leftu = s->dsp.add_hfyu_left_prediction(p->data[1] + 1, s->temp[1], width2 - 1, leftu);
leftv = s->dsp.add_hfyu_left_prediction(p->data[2] + 1, s->temp[2], width2 - 1, leftv);
leftu = s->hdsp.add_hfyu_left_pred(p->data[1] + 1, s->temp[1], width2 - 1, leftu);
leftv = s->hdsp.add_hfyu_left_pred(p->data[2] + 1, s->temp[2], width2 - 1, leftv);
}
cy = y = 1;
......@@ -604,31 +606,31 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
/* second line is left predicted for interlaced case */
if (s->interlaced) {
decode_422_bitstream(s, width);
lefty = s->dsp.add_hfyu_left_prediction(p->data[0] + p->linesize[0], s->temp[0], width, lefty);
lefty = s->hdsp.add_hfyu_left_pred(p->data[0] + p->linesize[0], s->temp[0], width, lefty);
if (!(s->flags & CODEC_FLAG_GRAY)) {
leftu = s->dsp.add_hfyu_left_prediction(p->data[1] + p->linesize[2], s->temp[1], width2, leftu);
leftv = s->dsp.add_hfyu_left_prediction(p->data[2] + p->linesize[1], s->temp[2], width2, leftv);
leftu = s->hdsp.add_hfyu_left_pred(p->data[1] + p->linesize[2], s->temp[1], width2, leftu);
leftv = s->hdsp.add_hfyu_left_pred(p->data[2] + p->linesize[1], s->temp[2], width2, leftv);
}
y++; cy++;
}
/* next 4 pixels are left predicted too */
decode_422_bitstream(s, 4);
lefty = s->dsp.add_hfyu_left_prediction(p->data[0] + fake_ystride, s->temp[0], 4, lefty);
lefty = s->hdsp.add_hfyu_left_pred(p->data[0] + fake_ystride, s->temp[0], 4, lefty);
if (!(s->flags&CODEC_FLAG_GRAY)) {
leftu = s->dsp.add_hfyu_left_prediction(p->data[1] + fake_ustride, s->temp[1], 2, leftu);
leftv = s->dsp.add_hfyu_left_prediction(p->data[2] + fake_vstride, s->temp[2], 2, leftv);
leftu = s->hdsp.add_hfyu_left_pred(p->data[1] + fake_ustride, s->temp[1], 2, leftu);
leftv = s->hdsp.add_hfyu_left_pred(p->data[2] + fake_vstride, s->temp[2], 2, leftv);
}
/* next line except the first 4 pixels is median predicted */
lefttopy = p->data[0][3];
decode_422_bitstream(s, width - 4);
s->dsp.add_hfyu_median_prediction(p->data[0] + fake_ystride+4, p->data[0]+4, s->temp[0], width-4, &lefty, &lefttopy);
s->hdsp.add_hfyu_median_pred(p->data[0] + fake_ystride + 4, p->data[0] + 4, s->temp[0], width - 4, &lefty, &lefttopy);
if (!(s->flags&CODEC_FLAG_GRAY)) {
lefttopu = p->data[1][1];
lefttopv = p->data[2][1];
s->dsp.add_hfyu_median_prediction(p->data[1] + fake_ustride+2, p->data[1] + 2, s->temp[1], width2 - 2, &leftu, &lefttopu);
s->dsp.add_hfyu_median_prediction(p->data[2] + fake_vstride+2, p->data[2] + 2, s->temp[2], width2 - 2, &leftv, &lefttopv);
s->hdsp.add_hfyu_median_pred(p->data[1] + fake_ustride + 2, p->data[1] + 2, s->temp[1], width2 - 2, &leftu, &lefttopu);
s->hdsp.add_hfyu_median_pred(p->data[2] + fake_vstride + 2, p->data[2] + 2, s->temp[2], width2 - 2, &leftv, &lefttopv);
}
y++; cy++;
......@@ -639,7 +641,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
while (2 * cy > y) {
decode_gray_bitstream(s, width);
ydst = p->data[0] + p->linesize[0] * y;
s->dsp.add_hfyu_median_prediction(ydst, ydst - fake_ystride, s->temp[0], width, &lefty, &lefttopy);
s->hdsp.add_hfyu_median_pred(ydst, ydst - fake_ystride, s->temp[0], width, &lefty, &lefttopy);
y++;
}
if (y >= height) break;
......@@ -652,10 +654,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
udst = p->data[1] + p->linesize[1] * cy;
vdst = p->data[2] + p->linesize[2] * cy;
s->dsp.add_hfyu_median_prediction(ydst, ydst - fake_ystride, s->temp[0], width, &lefty, &lefttopy);
s->hdsp.add_hfyu_median_pred(ydst, ydst - fake_ystride, s->temp[0], width, &lefty, &lefttopy);
if (!(s->flags & CODEC_FLAG_GRAY)) {
s->dsp.add_hfyu_median_prediction(udst, udst - fake_ustride, s->temp[1], width2, &leftu, &lefttopu);
s->dsp.add_hfyu_median_prediction(vdst, vdst - fake_vstride, s->temp[2], width2, &leftv, &lefttopv);
s->hdsp.add_hfyu_median_pred(udst, udst - fake_ustride, s->temp[1], width2, &leftu, &lefttopu);
s->hdsp.add_hfyu_median_pred(vdst, vdst - fake_vstride, s->temp[2], width2, &leftv, &lefttopv);
}
}
......@@ -686,19 +688,19 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
case LEFT:
case PLANE:
decode_bgr_bitstream(s, width - 1);
s->dsp.add_hfyu_left_prediction_bgr32(p->data[0] + last_line+4, s->temp[0], width - 1, &leftr, &leftg, &leftb, &lefta);
s->hdsp.add_hfyu_left_pred_bgr32(p->data[0] + last_line + 4, s->temp[0], width - 1, &leftr, &leftg, &leftb, &lefta);
for (y = s->height - 2; y >= 0; y--) { //Yes it is stored upside down.
decode_bgr_bitstream(s, width);
s->dsp.add_hfyu_left_prediction_bgr32(p->data[0] + p->linesize[0]*y, s->temp[0], width, &leftr, &leftg, &leftb, &lefta);
s->hdsp.add_hfyu_left_pred_bgr32(p->data[0] + p->linesize[0] * y, s->temp[0], width, &leftr, &leftg, &leftb, &lefta);
if (s->predictor == PLANE) {
if (s->bitstream_bpp != 32) lefta = 0;
if ((y & s->interlaced) == 0 &&
y < s->height - 1 - s->interlaced) {
s->dsp.add_bytes(p->data[0] + p->linesize[0] * y,
p->data[0] + p->linesize[0] * y +
fake_ystride, fake_ystride);
s->hdsp.add_bytes(p->data[0] + p->linesize[0] * y,
p->data[0] + p->linesize[0] * y +
fake_ystride, fake_ystride);
}
}
}
......
/*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdint.h>
#include "config.h"
#include "libavutil/attributes.h"
#include "mathops.h"
#include "huffyuvdsp.h"
// 0x7f7f7f7f or 0x7f7f7f7f7f7f7f7f or whatever, depending on the cpu's native arithmetic size
#define pb_7f (~0UL / 255 * 0x7f)
#define pb_80 (~0UL / 255 * 0x80)
static void add_bytes_c(uint8_t *dst, uint8_t *src, int w)
{
long i;
for (i = 0; i <= w - (int) sizeof(long); i += sizeof(long)) {
long a = *(long *) (src + i);
long b = *(long *) (dst + i);
*(long *) (dst + i) = ((a & pb_7f) + (b & pb_7f)) ^ ((a ^ b) & pb_80);
}
for (; i < w; i++)
dst[i + 0] += src[i + 0];
}
static void add_hfyu_median_pred_c(uint8_t *dst, const uint8_t *src1,
const uint8_t *diff, int w,
int *left, int *left_top)
{
int i;
uint8_t l, lt;
l = *left;
lt = *left_top;
for (i = 0; i < w; i++) {
l = mid_pred(l, src1[i], (l + src1[i] - lt) & 0xFF) + diff[i];
lt = src1[i];
dst[i] = l;
}
*left = l;
*left_top = lt;
}
static int add_hfyu_left_pred_c(uint8_t *dst, const uint8_t *src, int w,
int acc)
{
int i;
for (i = 0; i < w - 1; i++) {
acc += src[i];
dst[i] = acc;
i++;
acc += src[i];
dst[i] = acc;
}
for (; i < w; i++) {
acc += src[i];
dst[i] = acc;
}
return acc;
}
#if HAVE_BIGENDIAN
#define B 3
#define G 2
#define R 1
#define A 0
#else
#define B 0
#define G 1
#define R 2
#define A 3
#endif
static void add_hfyu_left_pred_bgr32_c(uint8_t *dst, const uint8_t *src,
int w, int *red, int *green,
int *blue, int *alpha)
{
int i, r = *red, g = *green, b = *blue, a = *alpha;
for (i = 0; i < w; i++) {
b += src[4 * i + B];
g += src[4 * i + G];
r += src[4 * i + R];
a += src[4 * i + A];
dst[4 * i + B] = b;
dst[4 * i + G] = g;
dst[4 * i + R] = r;
dst[4 * i + A] = a;
}
*red = r;
*green = g;
*blue = b;
*alpha = a;
}
#undef B
#undef G
#undef R
#undef A
av_cold void ff_huffyuvdsp_init(HuffYUVDSPContext *c)
{
c->add_bytes = add_bytes_c;
c->add_hfyu_median_pred = add_hfyu_median_pred_c;
c->add_hfyu_left_pred = add_hfyu_left_pred_c;
c->add_hfyu_left_pred_bgr32 = add_hfyu_left_pred_bgr32_c;
if (ARCH_X86)
ff_huffyuvdsp_init_x86(c);
}
/*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_HUFFYUVDSP_H
#define AVCODEC_HUFFYUVDSP_H
#include <stdint.h>
typedef struct HuffYUVDSPContext {
void (*add_bytes)(uint8_t *dst /* align 16 */, uint8_t *src /* align 16 */,
int w);
void (*add_hfyu_median_pred)(uint8_t *dst, const uint8_t *top,
const uint8_t *diff, int w,
int *left, int *left_top);
int (*add_hfyu_left_pred)(uint8_t *dst, const uint8_t *src,
int w, int left);
void (*add_hfyu_left_pred_bgr32)(uint8_t *dst, const uint8_t *src,
int w, int *red, int *green,
int *blue, int *alpha);
} HuffYUVDSPContext;
void ff_huffyuvdsp_init(HuffYUVDSPContext *c);
void ff_huffyuvdsp_init_ppc(HuffYUVDSPContext *c);
void ff_huffyuvdsp_init_x86(HuffYUVDSPContext *c);
#endif /* AVCODEC_HUFFYUVDSP_H */
......@@ -30,7 +30,7 @@
#include "avcodec.h"
#include "get_bits.h"
#include "mathops.h"
#include "dsputil.h"
#include "huffyuvdsp.h"
#include "lagarithrac.h"
#include "thread.h"
......@@ -50,7 +50,7 @@ enum LagarithFrameType {
typedef struct LagarithContext {
AVCodecContext *avctx;
DSPContext dsp;
HuffYUVDSPContext hdsp;
int zeros; /**< number of consecutive zero bytes encountered */
int zeros_rem; /**< number of zero bytes remaining to output */
uint8_t *rgb_planes;
......@@ -225,7 +225,7 @@ static void add_lag_median_prediction(uint8_t *dst, uint8_t *src1,
uint8_t *diff, int w, int *left,
int *left_top)
{
/* This is almost identical to add_hfyu_median_prediction in dsputil.h.
/* This is almost identical to add_hfyu_median_pred in huffyuvdsp.h.
* However the &0xFF on the gradient predictor yealds incorrect output
* for lagarith.
*/
......@@ -253,8 +253,7 @@ static void lag_pred_line(LagarithContext *l, uint8_t *buf,