summaryrefslogtreecommitdiff
path: root/libavcodec/i386/vp3dsp_mmx.c
diff options
context:
space:
mode:
authorMike Melanson <mike@multimedia.cx>2004-04-26 00:20:29 +0000
committerMike Melanson <mike@multimedia.cx>2004-04-26 00:20:29 +0000
commit116824d0aa1c416c3fb0f2c39d339fc00ae251f3 (patch)
tree0d062e4045aee066c0003234e1d4b716ad1b2c83 /libavcodec/i386/vp3dsp_mmx.c
parent4ea4b274697767abddda3c425ba4bb43dfdee52f (diff)
reorganize and simplify the VP3 IDCT stuff
Originally committed as revision 3071 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/i386/vp3dsp_mmx.c')
-rw-r--r--libavcodec/i386/vp3dsp_mmx.c80
1 files changed, 2 insertions, 78 deletions
diff --git a/libavcodec/i386/vp3dsp_mmx.c b/libavcodec/i386/vp3dsp_mmx.c
index 76007a1d16..319e57f1bb 100644
--- a/libavcodec/i386/vp3dsp_mmx.c
+++ b/libavcodec/i386/vp3dsp_mmx.c
@@ -279,8 +279,8 @@ void vp3_dsp_init_mmx(void)
idct_constants[46] = idct_constants[47] = IdctAdjustBeforeShift;
}
-static void vp3_idct_mmx(int16_t *input_data, int16_t *dequant_matrix,
- int16_t *output_data)
+void vp3_idct_mmx(int16_t *input_data, int16_t *dequant_matrix,
+ int coeff_count, int16_t *output_data)
{
/* eax = quantized input
* ebx = dequantizer matrix
@@ -563,79 +563,3 @@ static void vp3_idct_mmx(int16_t *input_data, int16_t *dequant_matrix,
#undef J
}
-
-void vp3_idct_put_mmx(int16_t *input_data, int16_t *dequant_matrix,
- int coeff_count, uint8_t *dest, int stride)
-{
- int16_t transformed_data[64];
- int16_t *op;
- int i, j;
- uint8_t vector128[8] = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 };
-
- vp3_idct_mmx(input_data, dequant_matrix, transformed_data);
-
- /* place in final output */
- op = transformed_data;
- movq_m2r(*vector128, mm0);
- for (i = 0; i < 8; i++) {
-#if 1
- for (j = 0; j < 8; j++) {
- if (*op < -128)
- *dest = 0;
- else if (*op > 127)
- *dest = 255;
- else
- *dest = (uint8_t)(*op + 128);
- op++;
- dest++;
- }
- dest += (stride - 8);
-#else
-/* prototype optimization */
- pxor_r2r(mm1, mm1);
- packsswb_m2r(*(op + 4), mm1);
- movq_r2r(mm1, mm2);
- psrlq_i2r(32, mm2);
- packsswb_m2r(*(op + 0), mm1);
- op += 8;
- por_r2r(mm2, mm1);
- paddb_r2r(mm0, mm1);
- movq_r2m(mm1, *dest);
- dest += stride;
-#endif
- }
-
- /* be a good MMX citizen */
- emms();
-}
-
-void vp3_idct_add_mmx(int16_t *input_data, int16_t *dequant_matrix,
- int coeff_count, uint8_t *dest, int stride)
-{
- int16_t transformed_data[64];
- int16_t *op;
- int i, j;
- int16_t sample;
-
- vp3_idct_mmx(input_data, dequant_matrix, transformed_data);
-
- /* place in final output */
- op = transformed_data;
- for (i = 0; i < 8; i++) {
- for (j = 0; j < 8; j++) {
- sample = *dest + *op;
- if (sample < 0)
- *dest = 0;
- else if (sample > 255)
- *dest = 255;
- else
- *dest = (uint8_t)(sample & 0xFF);
- op++;
- dest++;
- }
- dest += (stride - 8);
- }
-
- /* be a good MMX citizen */
- emms();
-}