summaryrefslogtreecommitdiff
path: root/src/libffmpeg/libavcodec/alpha/mpegvideo_alpha.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libffmpeg/libavcodec/alpha/mpegvideo_alpha.c')
-rw-r--r--src/libffmpeg/libavcodec/alpha/mpegvideo_alpha.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/libffmpeg/libavcodec/alpha/mpegvideo_alpha.c b/src/libffmpeg/libavcodec/alpha/mpegvideo_alpha.c
index 0be327079..350b53f62 100644
--- a/src/libffmpeg/libavcodec/alpha/mpegvideo_alpha.c
+++ b/src/libffmpeg/libavcodec/alpha/mpegvideo_alpha.c
@@ -21,8 +21,9 @@
#include "../dsputil.h"
#include "../mpegvideo.h"
-extern UINT8 zigzag_end[64];
-
+extern void simple_idct_put_axp(uint8_t *dest, int line_size, DCTELEM *block);
+extern void simple_idct_add_axp(uint8_t *dest, int line_size, DCTELEM *block);
+
static void dct_unquantize_h263_axp(MpegEncContext *s, DCTELEM *block,
int n, int qscale)
{
@@ -32,24 +33,26 @@ static void dct_unquantize_h263_axp(MpegEncContext *s, DCTELEM *block,
DCTELEM *orig_block = block;
DCTELEM block0;
+ qadd = WORD_VEC((qscale - 1) | 1);
+ qmul = qscale << 1;
+ /* This mask kills spill from negative subwords to the next subword. */
+ correction = WORD_VEC((qmul - 1) + 1); /* multiplication / addition */
+
if (s->mb_intra) {
if (!s->h263_aic) {
if (n < 4)
block0 = block[0] * s->y_dc_scale;
else
block0 = block[0] * s->c_dc_scale;
- }
- n_coeffs = 64; // does not always use zigzag table
+ } else {
+ qadd = 0;
+ }
+ n_coeffs = 63; // does not always use zigzag table
} else {
- n_coeffs = zigzag_end[s->block_last_index[n]];
+ n_coeffs = s->intra_scantable.raster_end[s->block_last_index[n]];
}
- qmul = qscale << 1;
- qadd = WORD_VEC((qscale - 1) | 1);
- /* This mask kills spill from negative subwords to the next subword. */
- correction = WORD_VEC((qmul - 1) + 1); /* multiplication / addition */
-
- for(i = 0; i < n_coeffs; block += 4, i += 4) {
+ for(i = 0; i <= n_coeffs; block += 4, i += 4) {
uint64_t levels, negmask, zeros, add;
levels = ldq(block);
@@ -94,4 +97,6 @@ static void dct_unquantize_h263_axp(MpegEncContext *s, DCTELEM *block,
void MPV_common_init_axp(MpegEncContext *s)
{
s->dct_unquantize_h263 = dct_unquantize_h263_axp;
+ s->idct_put = simple_idct_put_axp;
+ s->idct_add = simple_idct_add_axp;
}