mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-23 19:49:56 +00:00
idct: Change type of array stride parameters to ptrdiff_t
ptrdiff_t is the correct type for array strides and similar.
This commit is contained in:
parent
b2939a7527
commit
2ec9fa5ec6
@ -142,7 +142,7 @@ Alignment:
|
||||
Some instructions on some architectures have strict alignment restrictions,
|
||||
for example most SSE/SSE2 instructions on x86.
|
||||
The minimum guaranteed alignment is written in the .h files, for example:
|
||||
void (*put_pixels_clamped)(const int16_t *block/*align 16*/, UINT8 *pixels/*align 8*/, int line_size);
|
||||
void (*put_pixels_clamped)(const int16_t *block/*align 16*/, uint8_t *pixels/*align 8*/, ptrdiff_t stride);
|
||||
|
||||
|
||||
General Tips:
|
||||
|
@ -19,6 +19,7 @@
|
||||
#ifndef AVCODEC_ARM_IDCT_H
|
||||
#define AVCODEC_ARM_IDCT_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
void ff_j_rev_dct_arm(int16_t *data);
|
||||
@ -26,15 +27,15 @@ void ff_j_rev_dct_arm(int16_t *data);
|
||||
void ff_simple_idct_arm(int16_t *data);
|
||||
|
||||
void ff_simple_idct_armv5te(int16_t *data);
|
||||
void ff_simple_idct_put_armv5te(uint8_t *dest, int line_size, int16_t *data);
|
||||
void ff_simple_idct_add_armv5te(uint8_t *dest, int line_size, int16_t *data);
|
||||
void ff_simple_idct_put_armv5te(uint8_t *dest, ptrdiff_t line_size, int16_t *data);
|
||||
void ff_simple_idct_add_armv5te(uint8_t *dest, ptrdiff_t line_size, int16_t *data);
|
||||
|
||||
void ff_simple_idct_armv6(int16_t *data);
|
||||
void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, int16_t *data);
|
||||
void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, int16_t *data);
|
||||
void ff_simple_idct_put_armv6(uint8_t *dest, ptrdiff_t line_size, int16_t *data);
|
||||
void ff_simple_idct_add_armv6(uint8_t *dest, ptrdiff_t line_size, int16_t *data);
|
||||
|
||||
void ff_simple_idct_neon(int16_t *data);
|
||||
void ff_simple_idct_put_neon(uint8_t *dest, int line_size, int16_t *data);
|
||||
void ff_simple_idct_add_neon(uint8_t *dest, int line_size, int16_t *data);
|
||||
void ff_simple_idct_put_neon(uint8_t *dest, ptrdiff_t line_size, int16_t *data);
|
||||
void ff_simple_idct_add_neon(uint8_t *dest, ptrdiff_t line_size, int16_t *data);
|
||||
|
||||
#endif /* AVCODEC_ARM_IDCT_H */
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "config.h"
|
||||
#include "libavutil/arm/asm.S"
|
||||
|
||||
@ void ff_add_pixels_clamped_arm(int16_t *block, uint8_t *dest, int stride)
|
||||
@ void ff_add_pixels_clamped_arm(int16_t *block, uint8_t *dest, ptrdiff_t stride)
|
||||
function ff_add_pixels_clamped_arm, export=1, align=5
|
||||
push {r4-r10}
|
||||
mov r10, #8
|
||||
|
@ -19,6 +19,7 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
@ -30,29 +31,33 @@
|
||||
#include "idctdsp_arm.h"
|
||||
|
||||
void ff_add_pixels_clamped_arm(const int16_t *block, uint8_t *dest,
|
||||
int line_size);
|
||||
ptrdiff_t line_size);
|
||||
|
||||
/* XXX: those functions should be suppressed ASAP when all IDCTs are
|
||||
* converted */
|
||||
static void j_rev_dct_arm_put(uint8_t *dest, int line_size, int16_t *block)
|
||||
static void j_rev_dct_arm_put(uint8_t *dest, ptrdiff_t line_size,
|
||||
int16_t *block)
|
||||
{
|
||||
ff_j_rev_dct_arm(block);
|
||||
ff_put_pixels_clamped(block, dest, line_size);
|
||||
}
|
||||
|
||||
static void j_rev_dct_arm_add(uint8_t *dest, int line_size, int16_t *block)
|
||||
static void j_rev_dct_arm_add(uint8_t *dest, ptrdiff_t line_size,
|
||||
int16_t *block)
|
||||
{
|
||||
ff_j_rev_dct_arm(block);
|
||||
ff_add_pixels_clamped(block, dest, line_size);
|
||||
}
|
||||
|
||||
static void simple_idct_arm_put(uint8_t *dest, int line_size, int16_t *block)
|
||||
static void simple_idct_arm_put(uint8_t *dest, ptrdiff_t line_size,
|
||||
int16_t *block)
|
||||
{
|
||||
ff_simple_idct_arm(block);
|
||||
ff_put_pixels_clamped(block, dest, line_size);
|
||||
}
|
||||
|
||||
static void simple_idct_arm_add(uint8_t *dest, int line_size, int16_t *block)
|
||||
static void simple_idct_arm_add(uint8_t *dest, ptrdiff_t line_size,
|
||||
int16_t *block)
|
||||
{
|
||||
ff_simple_idct_arm(block);
|
||||
ff_add_pixels_clamped(block, dest, line_size);
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "idctdsp_arm.h"
|
||||
|
||||
void ff_add_pixels_clamped_armv6(const int16_t *block, uint8_t *pixels,
|
||||
int line_size);
|
||||
ptrdiff_t line_size);
|
||||
|
||||
av_cold void ff_idctdsp_init_armv6(IDCTDSPContext *c, AVCodecContext *avctx,
|
||||
unsigned high_bit_depth)
|
||||
|
@ -390,7 +390,7 @@ function ff_simple_idct_armv6, export=1
|
||||
pop {r4-r11, pc}
|
||||
endfunc
|
||||
|
||||
/* ff_simple_idct_add_armv6(uint8_t *dest, int line_size, int16_t *data); */
|
||||
/* ff_simple_idct_add_armv6(uint8_t *dest, ptrdiff_t line_size, int16_t *data); */
|
||||
function ff_simple_idct_add_armv6, export=1
|
||||
push {r0, r1, r4-r11, lr}
|
||||
sub sp, sp, #128
|
||||
@ -407,7 +407,7 @@ function ff_simple_idct_add_armv6, export=1
|
||||
pop {r4-r11, pc}
|
||||
endfunc
|
||||
|
||||
/* ff_simple_idct_put_armv6(uint8_t *dest, int line_size, int16_t *data); */
|
||||
/* ff_simple_idct_put_armv6(uint8_t *dest, ptrdiff_t line_size, int16_t *data); */
|
||||
function ff_simple_idct_put_armv6, export=1
|
||||
push {r0, r1, r4-r11, lr}
|
||||
sub sp, sp, #128
|
||||
|
@ -261,7 +261,7 @@ endconst
|
||||
pop {r4-r7, pc}
|
||||
.endm
|
||||
|
||||
/* void ff_simple_idct_put_neon(uint8_t *dst, int line_size, int16_t *data); */
|
||||
/* void ff_simple_idct_put_neon(uint8_t *dst, ptrdiff_t line_size, int16_t *data); */
|
||||
function ff_simple_idct_put_neon, export=1
|
||||
idct_start r2
|
||||
|
||||
@ -316,7 +316,7 @@ function idct_col4_add8_neon
|
||||
bx lr
|
||||
endfunc
|
||||
|
||||
/* void ff_simple_idct_add_neon(uint8_t *dst, int line_size, int16_t *data); */
|
||||
/* void ff_simple_idct_add_neon(uint8_t *dst, ptrdiff_t line_size, int16_t *data); */
|
||||
function ff_simple_idct_add_neon, export=1
|
||||
idct_start r2
|
||||
|
||||
|
@ -25,14 +25,14 @@
|
||||
#include "config.h"
|
||||
|
||||
void ff_vc1_inv_trans_8x8_neon(int16_t *block);
|
||||
void ff_vc1_inv_trans_4x8_neon(uint8_t *dest, int linesize, int16_t *block);
|
||||
void ff_vc1_inv_trans_8x4_neon(uint8_t *dest, int linesize, int16_t *block);
|
||||
void ff_vc1_inv_trans_4x4_neon(uint8_t *dest, int linesize, int16_t *block);
|
||||
void ff_vc1_inv_trans_4x8_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
||||
void ff_vc1_inv_trans_8x4_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
||||
void ff_vc1_inv_trans_4x4_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
||||
|
||||
void ff_vc1_inv_trans_8x8_dc_neon(uint8_t *dest, int linesize, int16_t *block);
|
||||
void ff_vc1_inv_trans_4x8_dc_neon(uint8_t *dest, int linesize, int16_t *block);
|
||||
void ff_vc1_inv_trans_8x4_dc_neon(uint8_t *dest, int linesize, int16_t *block);
|
||||
void ff_vc1_inv_trans_4x4_dc_neon(uint8_t *dest, int linesize, int16_t *block);
|
||||
void ff_vc1_inv_trans_8x8_dc_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
||||
void ff_vc1_inv_trans_4x8_dc_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
||||
void ff_vc1_inv_trans_8x4_dc_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
||||
void ff_vc1_inv_trans_4x4_dc_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
||||
|
||||
void ff_put_pixels8x8_neon(uint8_t *block, const uint8_t *pixels,
|
||||
ptrdiff_t line_size, int rnd);
|
||||
|
@ -426,7 +426,7 @@ function ff_vc1_inv_trans_8x8_neon, export=1
|
||||
bx lr
|
||||
endfunc
|
||||
|
||||
@ (uint8_t *dest [r0], int linesize [r1], int16_t *block [r2])
|
||||
@ (uint8_t *dest [r0], ptrdiff_t stride [r1], int16_t *block [r2])
|
||||
function ff_vc1_inv_trans_8x4_neon, export=1
|
||||
vld1.64 {q0-q1}, [r2,:128]! @ load 8 * 4 * 2 = 64 bytes / 16 bytes per quad = 4 quad registers
|
||||
vld1.64 {q2-q3}, [r2,:128]
|
||||
@ -511,7 +511,7 @@ function ff_vc1_inv_trans_8x4_neon, export=1
|
||||
bx lr
|
||||
endfunc
|
||||
|
||||
@ (uint8_t *dest [r0], int linesize [r1], int16_t *block [r2])
|
||||
@ (uint8_t *dest [r0], ptrdiff_t stride [r1], int16_t *block [r2])
|
||||
function ff_vc1_inv_trans_4x8_neon, export=1
|
||||
mov r12, #(8 * 2) @ 8 elements per line, each element 2 bytes
|
||||
vld4.16 {d0[], d2[], d4[], d6[]}, [r2,:64], r12 @ read each column into a q register
|
||||
@ -593,7 +593,7 @@ endfunc
|
||||
vshr.s16 q1, q1, #\rshift @ dst[3,1] >>= rshift
|
||||
.endm
|
||||
|
||||
@ (uint8_t *dest [r0], int linesize [r1], int16_t *block [r2])
|
||||
@ (uint8_t *dest [r0], ptrdiff_t stride [r1], int16_t *block [r2])
|
||||
function ff_vc1_inv_trans_4x4_neon, export=1
|
||||
mov r12, #(8 * 2) @ 8 elements per line, each element 2 bytes
|
||||
vld4.16 {d0[], d1[], d2[], d3[]}, [r2,:64], r12 @ read each column into a register
|
||||
|
@ -24,6 +24,7 @@
|
||||
#ifndef AVCODEC_DCT_H
|
||||
#define AVCODEC_DCT_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "rdft.h"
|
||||
@ -59,7 +60,7 @@ void ff_fdct248_islow_8(int16_t *data);
|
||||
void ff_fdct248_islow_10(int16_t *data);
|
||||
|
||||
void ff_j_rev_dct(int16_t *data);
|
||||
void ff_jref_idct_put(uint8_t *dest, int line_size, int16_t *block);
|
||||
void ff_jref_idct_add(uint8_t *dest, int line_size, int16_t *block);
|
||||
void ff_jref_idct_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block);
|
||||
void ff_jref_idct_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block);
|
||||
|
||||
#endif /* AVCODEC_DCT_H */
|
||||
|
@ -47,7 +47,7 @@ typedef struct DVVideoContext {
|
||||
|
||||
void (*get_pixels)(int16_t *block, const uint8_t *pixels, ptrdiff_t linesize);
|
||||
void (*fdct[2])(int16_t *block);
|
||||
void (*idct_put[2])(uint8_t *dest, int line_size, int16_t *block);
|
||||
void (*idct_put[2])(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
||||
me_cmp_func ildct_cmp;
|
||||
DVwork_chunk work_chunks[4 * 12 * 27];
|
||||
uint32_t idct_factor[2 * 4 * 16 * 64];
|
||||
|
@ -52,7 +52,7 @@ typedef struct BlockInfo {
|
||||
const uint32_t *factor_table;
|
||||
const uint8_t *scan_table;
|
||||
uint8_t pos; /* position in block */
|
||||
void (*idct_put)(uint8_t *dest, int line_size, int16_t *block);
|
||||
void (*idct_put)(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
||||
uint8_t partial_bit_count;
|
||||
uint32_t partial_bit_buffer;
|
||||
int shift_offset;
|
||||
|
@ -47,7 +47,9 @@ B6*B0/8, B6*B1/8, B6*B2/8, B6*B3/8, B6*B4/8, B6*B5/8, B6*B6/8, B6*B7/8,
|
||||
B7*B0/8, B7*B1/8, B7*B2/8, B7*B3/8, B7*B4/8, B7*B5/8, B7*B6/8, B7*B7/8,
|
||||
};
|
||||
|
||||
static inline void p8idct(int16_t data[64], FLOAT temp[64], uint8_t *dest, int stride, int x, int y, int type){
|
||||
static inline void p8idct(int16_t data[64], FLOAT temp[64], uint8_t *dest,
|
||||
ptrdiff_t stride, int x, int y, int type)
|
||||
{
|
||||
int i;
|
||||
FLOAT s04, d04, s17, d17, s26, d26, s53, d53;
|
||||
FLOAT os07, os16, os25, os34;
|
||||
@ -135,7 +137,8 @@ void ff_faanidct(int16_t block[64]){
|
||||
p8idct(block, temp, NULL, 0, 8, 1, 1);
|
||||
}
|
||||
|
||||
void ff_faanidct_add(uint8_t *dest, int line_size, int16_t block[64]){
|
||||
void ff_faanidct_add(uint8_t *dest, ptrdiff_t line_size, int16_t block[64])
|
||||
{
|
||||
FLOAT temp[64];
|
||||
int i;
|
||||
|
||||
@ -148,7 +151,8 @@ void ff_faanidct_add(uint8_t *dest, int line_size, int16_t block[64]){
|
||||
p8idct(NULL , temp, dest, line_size, 8, 1, 2);
|
||||
}
|
||||
|
||||
void ff_faanidct_put(uint8_t *dest, int line_size, int16_t block[64]){
|
||||
void ff_faanidct_put(uint8_t *dest, ptrdiff_t line_size, int16_t block[64])
|
||||
{
|
||||
FLOAT temp[64];
|
||||
int i;
|
||||
|
||||
|
@ -22,10 +22,11 @@
|
||||
#ifndef AVCODEC_FAANIDCT_H
|
||||
#define AVCODEC_FAANIDCT_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
void ff_faanidct(int16_t block[64]);
|
||||
void ff_faanidct_add(uint8_t *dest, int line_size, int16_t block[64]);
|
||||
void ff_faanidct_put(uint8_t *dest, int line_size, int16_t block[64]);
|
||||
void ff_faanidct_add(uint8_t *dest, ptrdiff_t line_size, int16_t block[64]);
|
||||
void ff_faanidct_put(uint8_t *dest, ptrdiff_t line_size, int16_t block[64]);
|
||||
|
||||
#endif /* AVCODEC_FAANIDCT_H */
|
||||
|
@ -79,11 +79,11 @@ av_cold void ff_init_scantable_permutation(uint8_t *idct_permutation,
|
||||
}
|
||||
}
|
||||
|
||||
void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
|
||||
void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
|
||||
void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, ptrdiff_t line_size);
|
||||
void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, ptrdiff_t line_size);
|
||||
|
||||
static void put_pixels_clamped_c(const int16_t *block, uint8_t *restrict pixels,
|
||||
int line_size)
|
||||
ptrdiff_t line_size)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -105,7 +105,7 @@ static void put_pixels_clamped_c(const int16_t *block, uint8_t *restrict pixels,
|
||||
|
||||
static void put_signed_pixels_clamped_c(const int16_t *block,
|
||||
uint8_t *restrict pixels,
|
||||
int line_size)
|
||||
ptrdiff_t line_size)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
@ -125,7 +125,7 @@ static void put_signed_pixels_clamped_c(const int16_t *block,
|
||||
}
|
||||
|
||||
static void add_pixels_clamped_c(const int16_t *block, uint8_t *restrict pixels,
|
||||
int line_size)
|
||||
ptrdiff_t line_size)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -52,13 +52,13 @@ typedef struct IDCTDSPContext {
|
||||
/* pixel ops : interface with DCT */
|
||||
void (*put_pixels_clamped)(const int16_t *block /* align 16 */,
|
||||
uint8_t *pixels /* align 8 */,
|
||||
int line_size);
|
||||
ptrdiff_t line_size);
|
||||
void (*put_signed_pixels_clamped)(const int16_t *block /* align 16 */,
|
||||
uint8_t *pixels /* align 8 */,
|
||||
int line_size);
|
||||
ptrdiff_t line_size);
|
||||
void (*add_pixels_clamped)(const int16_t *block /* align 16 */,
|
||||
uint8_t *pixels /* align 8 */,
|
||||
int line_size);
|
||||
ptrdiff_t line_size);
|
||||
|
||||
void (*idct)(int16_t *block /* align 16 */);
|
||||
|
||||
@ -68,14 +68,14 @@ typedef struct IDCTDSPContext {
|
||||
* @param line_size size in bytes of a horizontal line of dest
|
||||
*/
|
||||
void (*idct_put)(uint8_t *dest /* align 8 */,
|
||||
int line_size, int16_t *block /* align 16 */);
|
||||
ptrdiff_t line_size, int16_t *block /* align 16 */);
|
||||
|
||||
/**
|
||||
* block -> idct -> add dest -> clip to unsigned 8 bit -> dest.
|
||||
* @param line_size size in bytes of a horizontal line of dest
|
||||
*/
|
||||
void (*idct_add)(uint8_t *dest /* align 8 */,
|
||||
int line_size, int16_t *block /* align 16 */);
|
||||
ptrdiff_t line_size, int16_t *block /* align 16 */);
|
||||
|
||||
/**
|
||||
* IDCT input permutation.
|
||||
@ -95,8 +95,8 @@ typedef struct IDCTDSPContext {
|
||||
enum idct_permutation_type perm_type;
|
||||
} IDCTDSPContext;
|
||||
|
||||
extern void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
|
||||
extern void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
|
||||
extern void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, ptrdiff_t line_size);
|
||||
extern void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, ptrdiff_t line_size);
|
||||
|
||||
void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx);
|
||||
|
||||
|
@ -943,13 +943,13 @@ void ff_j_rev_dct(DCTBLOCK data)
|
||||
}
|
||||
}
|
||||
|
||||
void ff_jref_idct_put(uint8_t *dest, int line_size, int16_t *block)
|
||||
void ff_jref_idct_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
|
||||
{
|
||||
ff_j_rev_dct(block);
|
||||
ff_put_pixels_clamped(block, dest, line_size);
|
||||
}
|
||||
|
||||
void ff_jref_idct_add(uint8_t *dest, int line_size, int16_t *block)
|
||||
void ff_jref_idct_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
|
||||
{
|
||||
ff_j_rev_dct(block);
|
||||
ff_add_pixels_clamped(block, dest, line_size);
|
||||
|
@ -153,7 +153,7 @@ static const vec_s16 constants[5] = {
|
||||
{ 19266, 26722, 25172, 22654, 19266, 22654, 25172, 26722 }
|
||||
};
|
||||
|
||||
static void idct_put_altivec(uint8_t *dest, int stride, int16_t *blk)
|
||||
static void idct_put_altivec(uint8_t *dest, ptrdiff_t stride, int16_t *blk)
|
||||
{
|
||||
vec_s16 *block = (vec_s16 *) blk;
|
||||
vec_u8 tmp;
|
||||
@ -182,7 +182,7 @@ static void idct_put_altivec(uint8_t *dest, int stride, int16_t *blk)
|
||||
COPY(dest, vx7);
|
||||
}
|
||||
|
||||
static void idct_add_altivec(uint8_t *dest, int stride, int16_t *blk)
|
||||
static void idct_add_altivec(uint8_t *dest, ptrdiff_t stride, int16_t *blk)
|
||||
{
|
||||
vec_s16 *block = (vec_s16 *) blk;
|
||||
vec_u8 tmp;
|
||||
|
@ -229,7 +229,8 @@ static void vc1_inv_trans_8x8_altivec(int16_t block[64])
|
||||
|
||||
/** Do inverse transform on 8x4 part of block
|
||||
*/
|
||||
static void vc1_inv_trans_8x4_altivec(uint8_t *dest, int stride, int16_t *block)
|
||||
static void vc1_inv_trans_8x4_altivec(uint8_t *dest, ptrdiff_t stride,
|
||||
int16_t *block)
|
||||
{
|
||||
vector signed short src0, src1, src2, src3, src4, src5, src6, src7;
|
||||
vector signed int s0, s1, s2, s3, s4, s5, s6, s7;
|
||||
|
@ -49,7 +49,7 @@
|
||||
and the butterfly must be multiplied by 0.5 * sqrt(2.0) */
|
||||
#define C_SHIFT (4+1+12)
|
||||
|
||||
static inline void idct4col_put(uint8_t *dest, int line_size, const int16_t *col)
|
||||
static inline void idct4col_put(uint8_t *dest, ptrdiff_t line_size, const int16_t *col)
|
||||
{
|
||||
int c0, c1, c2, c3, a0, a1, a2, a3;
|
||||
|
||||
@ -85,7 +85,7 @@ static inline void idct4col_put(uint8_t *dest, int line_size, const int16_t *col
|
||||
/* XXX: I think a 1.0/sqrt(2) normalization should be needed to
|
||||
compensate the extra butterfly stage - I don't have the full DV
|
||||
specification */
|
||||
void ff_simple_idct248_put(uint8_t *dest, int line_size, int16_t *block)
|
||||
void ff_simple_idct248_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
|
||||
{
|
||||
int i;
|
||||
int16_t *ptr;
|
||||
@ -128,7 +128,7 @@ void ff_simple_idct248_put(uint8_t *dest, int line_size, int16_t *block)
|
||||
#define C2 C_FIX(0.2705980501)
|
||||
#define C3 C_FIX(0.5)
|
||||
#define C_SHIFT (4+1+12)
|
||||
static inline void idct4col_add(uint8_t *dest, int line_size, const int16_t *col)
|
||||
static inline void idct4col_add(uint8_t *dest, ptrdiff_t line_size, const int16_t *col)
|
||||
{
|
||||
int c0, c1, c2, c3, a0, a1, a2, a3;
|
||||
|
||||
@ -173,7 +173,7 @@ static inline void idct4row(int16_t *row)
|
||||
row[3]= (c0 - c1) >> R_SHIFT;
|
||||
}
|
||||
|
||||
void ff_simple_idct84_add(uint8_t *dest, int line_size, int16_t *block)
|
||||
void ff_simple_idct84_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -188,7 +188,7 @@ void ff_simple_idct84_add(uint8_t *dest, int line_size, int16_t *block)
|
||||
}
|
||||
}
|
||||
|
||||
void ff_simple_idct48_add(uint8_t *dest, int line_size, int16_t *block)
|
||||
void ff_simple_idct48_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -203,7 +203,7 @@ void ff_simple_idct48_add(uint8_t *dest, int line_size, int16_t *block)
|
||||
}
|
||||
}
|
||||
|
||||
void ff_simple_idct44_add(uint8_t *dest, int line_size, int16_t *block)
|
||||
void ff_simple_idct44_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -28,14 +28,15 @@
|
||||
#ifndef AVCODEC_SIMPLE_IDCT_H
|
||||
#define AVCODEC_SIMPLE_IDCT_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
void ff_simple_idct_put_8(uint8_t *dest, int line_size, int16_t *block);
|
||||
void ff_simple_idct_add_8(uint8_t *dest, int line_size, int16_t *block);
|
||||
void ff_simple_idct_put_8(uint8_t *dest, ptrdiff_t line_size, int16_t *block);
|
||||
void ff_simple_idct_add_8(uint8_t *dest, ptrdiff_t line_size, int16_t *block);
|
||||
void ff_simple_idct_8(int16_t *block);
|
||||
|
||||
void ff_simple_idct_put_10(uint8_t *dest, int line_size, int16_t *block);
|
||||
void ff_simple_idct_add_10(uint8_t *dest, int line_size, int16_t *block);
|
||||
void ff_simple_idct_put_10(uint8_t *dest, ptrdiff_t line_size, int16_t *block);
|
||||
void ff_simple_idct_add_10(uint8_t *dest, ptrdiff_t line_size, int16_t *block);
|
||||
void ff_simple_idct_10(int16_t *block);
|
||||
/**
|
||||
* Special version of ff_simple_idct_10() which does dequantization
|
||||
@ -44,10 +45,10 @@ void ff_simple_idct_10(int16_t *block);
|
||||
*/
|
||||
void ff_prores_idct(int16_t *block, const int16_t *qmat);
|
||||
|
||||
void ff_simple_idct248_put(uint8_t *dest, int line_size, int16_t *block);
|
||||
void ff_simple_idct248_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block);
|
||||
|
||||
void ff_simple_idct84_add(uint8_t *dest, int line_size, int16_t *block);
|
||||
void ff_simple_idct48_add(uint8_t *dest, int line_size, int16_t *block);
|
||||
void ff_simple_idct44_add(uint8_t *dest, int line_size, int16_t *block);
|
||||
void ff_simple_idct84_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block);
|
||||
void ff_simple_idct48_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block);
|
||||
void ff_simple_idct44_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block);
|
||||
|
||||
#endif /* AVCODEC_SIMPLE_IDCT_H */
|
||||
|
@ -222,7 +222,7 @@ static inline void FUNC(idctRowCondDC)(int16_t *row, int extra_shift)
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
static inline void FUNC(idctSparseColPut)(pixel *dest, int line_size,
|
||||
static inline void FUNC(idctSparseColPut)(pixel *dest, ptrdiff_t line_size,
|
||||
int16_t *col)
|
||||
{
|
||||
int a0, a1, a2, a3, b0, b1, b2, b3;
|
||||
@ -246,7 +246,7 @@ static inline void FUNC(idctSparseColPut)(pixel *dest, int line_size,
|
||||
dest[0] = av_clip_pixel((a0 - b0) >> COL_SHIFT);
|
||||
}
|
||||
|
||||
static inline void FUNC(idctSparseColAdd)(pixel *dest, int line_size,
|
||||
static inline void FUNC(idctSparseColAdd)(pixel *dest, ptrdiff_t line_size,
|
||||
int16_t *col)
|
||||
{
|
||||
int a0, a1, a2, a3, b0, b1, b2, b3;
|
||||
@ -286,7 +286,7 @@ static inline void FUNC(idctSparseCol)(int16_t *col)
|
||||
col[56] = ((a0 - b0) >> COL_SHIFT);
|
||||
}
|
||||
|
||||
void FUNC(ff_simple_idct_put)(uint8_t *dest_, int line_size, int16_t *block)
|
||||
void FUNC(ff_simple_idct_put)(uint8_t *dest_, ptrdiff_t line_size, int16_t *block)
|
||||
{
|
||||
pixel *dest = (pixel *)dest_;
|
||||
int i;
|
||||
@ -300,7 +300,7 @@ void FUNC(ff_simple_idct_put)(uint8_t *dest_, int line_size, int16_t *block)
|
||||
FUNC(idctSparseColPut)(dest + i, line_size, block + i);
|
||||
}
|
||||
|
||||
void FUNC(ff_simple_idct_add)(uint8_t *dest_, int line_size, int16_t *block)
|
||||
void FUNC(ff_simple_idct_add)(uint8_t *dest_, ptrdiff_t line_size, int16_t *block)
|
||||
{
|
||||
pixel *dest = (pixel *)dest_;
|
||||
int i;
|
||||
|
@ -253,7 +253,7 @@ static int dct_error(const struct algo *dct, int test, int is_idct, int speed)
|
||||
DECLARE_ALIGNED(8, static uint8_t, img_dest)[64];
|
||||
DECLARE_ALIGNED(8, static uint8_t, img_dest1)[64];
|
||||
|
||||
static void idct248_ref(uint8_t *dest, int linesize, int16_t *block)
|
||||
static void idct248_ref(uint8_t *dest, ptrdiff_t linesize, int16_t *block)
|
||||
{
|
||||
static int init;
|
||||
static double c8[8][8];
|
||||
@ -334,7 +334,8 @@ static void idct248_ref(uint8_t *dest, int linesize, int16_t *block)
|
||||
}
|
||||
|
||||
static void idct248_error(const char *name,
|
||||
void (*idct248_put)(uint8_t *dest, int line_size,
|
||||
void (*idct248_put)(uint8_t *dest,
|
||||
ptrdiff_t line_size,
|
||||
int16_t *block),
|
||||
int speed)
|
||||
{
|
||||
|
@ -235,7 +235,7 @@ static void vc1_h_loop_filter16_c(uint8_t *src, int stride, int pq)
|
||||
}
|
||||
|
||||
/* Do inverse transform on 8x8 block */
|
||||
static void vc1_inv_trans_8x8_dc_c(uint8_t *dest, int linesize, int16_t *block)
|
||||
static void vc1_inv_trans_8x8_dc_c(uint8_t *dest, ptrdiff_t stride, int16_t *block)
|
||||
{
|
||||
int i;
|
||||
int dc = block[0];
|
||||
@ -252,7 +252,7 @@ static void vc1_inv_trans_8x8_dc_c(uint8_t *dest, int linesize, int16_t *block)
|
||||
dest[5] = av_clip_uint8(dest[5] + dc);
|
||||
dest[6] = av_clip_uint8(dest[6] + dc);
|
||||
dest[7] = av_clip_uint8(dest[7] + dc);
|
||||
dest += linesize;
|
||||
dest += stride;
|
||||
}
|
||||
}
|
||||
|
||||
@ -326,7 +326,7 @@ static void vc1_inv_trans_8x8_c(int16_t block[64])
|
||||
}
|
||||
|
||||
/* Do inverse transform on 8x4 part of block */
|
||||
static void vc1_inv_trans_8x4_dc_c(uint8_t *dest, int linesize, int16_t *block)
|
||||
static void vc1_inv_trans_8x4_dc_c(uint8_t *dest, ptrdiff_t stride, int16_t *block)
|
||||
{
|
||||
int i;
|
||||
int dc = block[0];
|
||||
@ -343,11 +343,11 @@ static void vc1_inv_trans_8x4_dc_c(uint8_t *dest, int linesize, int16_t *block)
|
||||
dest[5] = av_clip_uint8(dest[5] + dc);
|
||||
dest[6] = av_clip_uint8(dest[6] + dc);
|
||||
dest[7] = av_clip_uint8(dest[7] + dc);
|
||||
dest += linesize;
|
||||
dest += stride;
|
||||
}
|
||||
}
|
||||
|
||||
static void vc1_inv_trans_8x4_c(uint8_t *dest, int linesize, int16_t *block)
|
||||
static void vc1_inv_trans_8x4_c(uint8_t *dest, ptrdiff_t stride, int16_t *block)
|
||||
{
|
||||
int i;
|
||||
register int t1, t2, t3, t4, t5, t6, t7, t8;
|
||||
@ -392,10 +392,10 @@ static void vc1_inv_trans_8x4_c(uint8_t *dest, int linesize, int16_t *block)
|
||||
t3 = 22 * src[ 8] + 10 * src[24];
|
||||
t4 = 22 * src[24] - 10 * src[ 8];
|
||||
|
||||
dest[0 * linesize] = av_clip_uint8(dest[0 * linesize] + ((t1 + t3) >> 7));
|
||||
dest[1 * linesize] = av_clip_uint8(dest[1 * linesize] + ((t2 - t4) >> 7));
|
||||
dest[2 * linesize] = av_clip_uint8(dest[2 * linesize] + ((t2 + t4) >> 7));
|
||||
dest[3 * linesize] = av_clip_uint8(dest[3 * linesize] + ((t1 - t3) >> 7));
|
||||
dest[0 * stride] = av_clip_uint8(dest[0 * stride] + ((t1 + t3) >> 7));
|
||||
dest[1 * stride] = av_clip_uint8(dest[1 * stride] + ((t2 - t4) >> 7));
|
||||
dest[2 * stride] = av_clip_uint8(dest[2 * stride] + ((t2 + t4) >> 7));
|
||||
dest[3 * stride] = av_clip_uint8(dest[3 * stride] + ((t1 - t3) >> 7));
|
||||
|
||||
src++;
|
||||
dest++;
|
||||
@ -403,7 +403,7 @@ static void vc1_inv_trans_8x4_c(uint8_t *dest, int linesize, int16_t *block)
|
||||
}
|
||||
|
||||
/* Do inverse transform on 4x8 parts of block */
|
||||
static void vc1_inv_trans_4x8_dc_c(uint8_t *dest, int linesize, int16_t *block)
|
||||
static void vc1_inv_trans_4x8_dc_c(uint8_t *dest, ptrdiff_t stride, int16_t *block)
|
||||
{
|
||||
int i;
|
||||
int dc = block[0];
|
||||
@ -416,11 +416,11 @@ static void vc1_inv_trans_4x8_dc_c(uint8_t *dest, int linesize, int16_t *block)
|
||||
dest[1] = av_clip_uint8(dest[1] + dc);
|
||||
dest[2] = av_clip_uint8(dest[2] + dc);
|
||||
dest[3] = av_clip_uint8(dest[3] + dc);
|
||||
dest += linesize;
|
||||
dest += stride;
|
||||
}
|
||||
}
|
||||
|
||||
static void vc1_inv_trans_4x8_c(uint8_t *dest, int linesize, int16_t *block)
|
||||
static void vc1_inv_trans_4x8_c(uint8_t *dest, ptrdiff_t stride, int16_t *block)
|
||||
{
|
||||
int i;
|
||||
register int t1, t2, t3, t4, t5, t6, t7, t8;
|
||||
@ -461,14 +461,14 @@ static void vc1_inv_trans_4x8_c(uint8_t *dest, int linesize, int16_t *block)
|
||||
t3 = 9 * src[ 8] - 16 * src[24] + 4 * src[40] + 15 * src[56];
|
||||
t4 = 4 * src[ 8] - 9 * src[24] + 15 * src[40] - 16 * src[56];
|
||||
|
||||
dest[0 * linesize] = av_clip_uint8(dest[0 * linesize] + ((t5 + t1) >> 7));
|
||||
dest[1 * linesize] = av_clip_uint8(dest[1 * linesize] + ((t6 + t2) >> 7));
|
||||
dest[2 * linesize] = av_clip_uint8(dest[2 * linesize] + ((t7 + t3) >> 7));
|
||||
dest[3 * linesize] = av_clip_uint8(dest[3 * linesize] + ((t8 + t4) >> 7));
|
||||
dest[4 * linesize] = av_clip_uint8(dest[4 * linesize] + ((t8 - t4 + 1) >> 7));
|
||||
dest[5 * linesize] = av_clip_uint8(dest[5 * linesize] + ((t7 - t3 + 1) >> 7));
|
||||
dest[6 * linesize] = av_clip_uint8(dest[6 * linesize] + ((t6 - t2 + 1) >> 7));
|
||||
dest[7 * linesize] = av_clip_uint8(dest[7 * linesize] + ((t5 - t1 + 1) >> 7));
|
||||
dest[0 * stride] = av_clip_uint8(dest[0 * stride] + ((t5 + t1) >> 7));
|
||||
dest[1 * stride] = av_clip_uint8(dest[1 * stride] + ((t6 + t2) >> 7));
|
||||
dest[2 * stride] = av_clip_uint8(dest[2 * stride] + ((t7 + t3) >> 7));
|
||||
dest[3 * stride] = av_clip_uint8(dest[3 * stride] + ((t8 + t4) >> 7));
|
||||
dest[4 * stride] = av_clip_uint8(dest[4 * stride] + ((t8 - t4 + 1) >> 7));
|
||||
dest[5 * stride] = av_clip_uint8(dest[5 * stride] + ((t7 - t3 + 1) >> 7));
|
||||
dest[6 * stride] = av_clip_uint8(dest[6 * stride] + ((t6 - t2 + 1) >> 7));
|
||||
dest[7 * stride] = av_clip_uint8(dest[7 * stride] + ((t5 - t1 + 1) >> 7));
|
||||
|
||||
src++;
|
||||
dest++;
|
||||
@ -476,7 +476,7 @@ static void vc1_inv_trans_4x8_c(uint8_t *dest, int linesize, int16_t *block)
|
||||
}
|
||||
|
||||
/* Do inverse transform on 4x4 part of block */
|
||||
static void vc1_inv_trans_4x4_dc_c(uint8_t *dest, int linesize, int16_t *block)
|
||||
static void vc1_inv_trans_4x4_dc_c(uint8_t *dest, ptrdiff_t stride, int16_t *block)
|
||||
{
|
||||
int i;
|
||||
int dc = block[0];
|
||||
@ -489,11 +489,11 @@ static void vc1_inv_trans_4x4_dc_c(uint8_t *dest, int linesize, int16_t *block)
|
||||
dest[1] = av_clip_uint8(dest[1] + dc);
|
||||
dest[2] = av_clip_uint8(dest[2] + dc);
|
||||
dest[3] = av_clip_uint8(dest[3] + dc);
|
||||
dest += linesize;
|
||||
dest += stride;
|
||||
}
|
||||
}
|
||||
|
||||
static void vc1_inv_trans_4x4_c(uint8_t *dest, int linesize, int16_t *block)
|
||||
static void vc1_inv_trans_4x4_c(uint8_t *dest, ptrdiff_t stride, int16_t *block)
|
||||
{
|
||||
int i;
|
||||
register int t1, t2, t3, t4;
|
||||
@ -523,10 +523,10 @@ static void vc1_inv_trans_4x4_c(uint8_t *dest, int linesize, int16_t *block)
|
||||
t3 = 22 * src[8] + 10 * src[24];
|
||||
t4 = 22 * src[24] - 10 * src[8];
|
||||
|
||||
dest[0 * linesize] = av_clip_uint8(dest[0 * linesize] + ((t1 + t3) >> 7));
|
||||
dest[1 * linesize] = av_clip_uint8(dest[1 * linesize] + ((t2 - t4) >> 7));
|
||||
dest[2 * linesize] = av_clip_uint8(dest[2 * linesize] + ((t2 + t4) >> 7));
|
||||
dest[3 * linesize] = av_clip_uint8(dest[3 * linesize] + ((t1 - t3) >> 7));
|
||||
dest[0 * stride] = av_clip_uint8(dest[0 * stride] + ((t1 + t3) >> 7));
|
||||
dest[1 * stride] = av_clip_uint8(dest[1 * stride] + ((t2 - t4) >> 7));
|
||||
dest[2 * stride] = av_clip_uint8(dest[2 * stride] + ((t2 + t4) >> 7));
|
||||
dest[3 * stride] = av_clip_uint8(dest[3 * stride] + ((t1 - t3) >> 7));
|
||||
|
||||
src++;
|
||||
dest++;
|
||||
|
@ -33,13 +33,13 @@
|
||||
typedef struct VC1DSPContext {
|
||||
/* vc1 functions */
|
||||
void (*vc1_inv_trans_8x8)(int16_t *b);
|
||||
void (*vc1_inv_trans_8x4)(uint8_t *dest, int line_size, int16_t *block);
|
||||
void (*vc1_inv_trans_4x8)(uint8_t *dest, int line_size, int16_t *block);
|
||||
void (*vc1_inv_trans_4x4)(uint8_t *dest, int line_size, int16_t *block);
|
||||
void (*vc1_inv_trans_8x8_dc)(uint8_t *dest, int line_size, int16_t *block);
|
||||
void (*vc1_inv_trans_8x4_dc)(uint8_t *dest, int line_size, int16_t *block);
|
||||
void (*vc1_inv_trans_4x8_dc)(uint8_t *dest, int line_size, int16_t *block);
|
||||
void (*vc1_inv_trans_4x4_dc)(uint8_t *dest, int line_size, int16_t *block);
|
||||
void (*vc1_inv_trans_8x4)(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
||||
void (*vc1_inv_trans_4x8)(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
||||
void (*vc1_inv_trans_4x4)(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
||||
void (*vc1_inv_trans_8x8_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
||||
void (*vc1_inv_trans_8x4_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
||||
void (*vc1_inv_trans_4x8_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
||||
void (*vc1_inv_trans_4x4_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
||||
void (*vc1_v_overlap)(uint8_t *src, int stride);
|
||||
void (*vc1_h_overlap)(uint8_t *src, int stride);
|
||||
void (*vc1_v_s_overlap)(int16_t *top, int16_t *bottom);
|
||||
|
@ -93,7 +93,7 @@ static void wmv2_idct_col(short * b)
|
||||
b[8 * 7] = (a0 + a2 - a1 - a5 + (1 << 13)) >> 14;
|
||||
}
|
||||
|
||||
static void wmv2_idct_add_c(uint8_t *dest, int line_size, int16_t *block)
|
||||
static void wmv2_idct_add_c(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -116,7 +116,7 @@ static void wmv2_idct_add_c(uint8_t *dest, int line_size, int16_t *block)
|
||||
}
|
||||
}
|
||||
|
||||
static void wmv2_idct_put_c(uint8_t *dest, int line_size, int16_t *block)
|
||||
static void wmv2_idct_put_c(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -24,8 +24,8 @@
|
||||
#include "qpeldsp.h"
|
||||
|
||||
typedef struct WMV2DSPContext {
|
||||
void (*idct_add)(uint8_t *dest, int line_size, int16_t *block);
|
||||
void (*idct_put)(uint8_t *dest, int line_size, int16_t *block);
|
||||
void (*idct_add)(uint8_t *dest, ptrdiff_t line_size, int16_t *block);
|
||||
void (*idct_put)(uint8_t *dest, ptrdiff_t line_size, int16_t *block);
|
||||
|
||||
qpel_mc_func put_mspel_pixels_tab[8];
|
||||
|
||||
|
@ -19,13 +19,14 @@
|
||||
#ifndef AVCODEC_X86_IDCTDSP_H
|
||||
#define AVCODEC_X86_IDCTDSP_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
void ff_add_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
|
||||
int line_size);
|
||||
ptrdiff_t line_size);
|
||||
void ff_put_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
|
||||
int line_size);
|
||||
ptrdiff_t line_size);
|
||||
void ff_put_signed_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
|
||||
int line_size);
|
||||
ptrdiff_t line_size);
|
||||
|
||||
#endif /* AVCODEC_X86_IDCTDSP_H */
|
||||
|
@ -31,7 +31,7 @@
|
||||
#if HAVE_INLINE_ASM
|
||||
|
||||
void ff_put_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
|
||||
int line_size)
|
||||
ptrdiff_t line_size)
|
||||
{
|
||||
const int16_t *p;
|
||||
uint8_t *pix;
|
||||
@ -107,7 +107,7 @@ void ff_put_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
|
||||
"movq %%mm4, (%0, %1) \n\t"
|
||||
|
||||
void ff_put_signed_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
|
||||
int line_size)
|
||||
ptrdiff_t line_size)
|
||||
{
|
||||
x86_reg line_skip = line_size;
|
||||
x86_reg line_skip3;
|
||||
@ -124,7 +124,7 @@ void ff_put_signed_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
|
||||
}
|
||||
|
||||
void ff_add_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
|
||||
int line_size)
|
||||
ptrdiff_t line_size)
|
||||
{
|
||||
const int16_t *p;
|
||||
uint8_t *pix;
|
||||
|
@ -904,12 +904,12 @@ void ff_simple_idct_mmx(int16_t *block)
|
||||
|
||||
//FIXME merge add/put into the idct
|
||||
|
||||
void ff_simple_idct_put_mmx(uint8_t *dest, int line_size, int16_t *block)
|
||||
void ff_simple_idct_put_mmx(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
|
||||
{
|
||||
idct(block);
|
||||
ff_put_pixels_clamped(block, dest, line_size);
|
||||
}
|
||||
void ff_simple_idct_add_mmx(uint8_t *dest, int line_size, int16_t *block)
|
||||
void ff_simple_idct_add_mmx(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
|
||||
{
|
||||
idct(block);
|
||||
ff_add_pixels_clamped(block, dest, line_size);
|
||||
|
@ -19,10 +19,11 @@
|
||||
#ifndef AVCODEC_X86_SIMPLE_IDCT_H
|
||||
#define AVCODEC_X86_SIMPLE_IDCT_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
void ff_simple_idct_mmx(int16_t *block);
|
||||
void ff_simple_idct_add_mmx(uint8_t *dest, int line_size, int16_t *block);
|
||||
void ff_simple_idct_put_mmx(uint8_t *dest, int line_size, int16_t *block);
|
||||
void ff_simple_idct_add_mmx(uint8_t *dest, ptrdiff_t line_size, int16_t *block);
|
||||
void ff_simple_idct_put_mmx(uint8_t *dest, ptrdiff_t line_size, int16_t *block);
|
||||
|
||||
#endif /* AVCODEC_X86_SIMPLE_IDCT_H */
|
||||
|
@ -498,7 +498,7 @@ DECLARE_FUNCTION(3, 1)
|
||||
DECLARE_FUNCTION(3, 2)
|
||||
DECLARE_FUNCTION(3, 3)
|
||||
|
||||
static void vc1_inv_trans_4x4_dc_mmxext(uint8_t *dest, int linesize,
|
||||
static void vc1_inv_trans_4x4_dc_mmxext(uint8_t *dest, ptrdiff_t stride,
|
||||
int16_t *block)
|
||||
{
|
||||
int dc = block[0];
|
||||
@ -530,14 +530,14 @@ static void vc1_inv_trans_4x4_dc_mmxext(uint8_t *dest, int linesize,
|
||||
"movd %%mm3, %1 \n\t"
|
||||
"movd %%mm4, %2 \n\t"
|
||||
"movd %%mm5, %3 \n\t"
|
||||
:"+m"(*(uint32_t*)(dest+0*linesize)),
|
||||
"+m"(*(uint32_t*)(dest+1*linesize)),
|
||||
"+m"(*(uint32_t*)(dest+2*linesize)),
|
||||
"+m"(*(uint32_t*)(dest+3*linesize))
|
||||
:"+m"(*(uint32_t *)(dest + 0 * stride)),
|
||||
"+m"(*(uint32_t *)(dest + 1 * stride)),
|
||||
"+m"(*(uint32_t *)(dest + 2 * stride)),
|
||||
"+m"(*(uint32_t *)(dest + 3 * stride))
|
||||
);
|
||||
}
|
||||
|
||||
static void vc1_inv_trans_4x8_dc_mmxext(uint8_t *dest, int linesize,
|
||||
static void vc1_inv_trans_4x8_dc_mmxext(uint8_t *dest, ptrdiff_t stride,
|
||||
int16_t *block)
|
||||
{
|
||||
int dc = block[0];
|
||||
@ -569,12 +569,12 @@ static void vc1_inv_trans_4x8_dc_mmxext(uint8_t *dest, int linesize,
|
||||
"movd %%mm3, %1 \n\t"
|
||||
"movd %%mm4, %2 \n\t"
|
||||
"movd %%mm5, %3 \n\t"
|
||||
:"+m"(*(uint32_t*)(dest+0*linesize)),
|
||||
"+m"(*(uint32_t*)(dest+1*linesize)),
|
||||
"+m"(*(uint32_t*)(dest+2*linesize)),
|
||||
"+m"(*(uint32_t*)(dest+3*linesize))
|
||||
:"+m"(*(uint32_t *)(dest + 0 * stride)),
|
||||
"+m"(*(uint32_t *)(dest + 1 * stride)),
|
||||
"+m"(*(uint32_t *)(dest + 2 * stride)),
|
||||
"+m"(*(uint32_t *)(dest + 3 * stride))
|
||||
);
|
||||
dest += 4*linesize;
|
||||
dest += 4 * stride;
|
||||
__asm__ volatile(
|
||||
"movd %0, %%mm2 \n\t"
|
||||
"movd %1, %%mm3 \n\t"
|
||||
@ -592,14 +592,14 @@ static void vc1_inv_trans_4x8_dc_mmxext(uint8_t *dest, int linesize,
|
||||
"movd %%mm3, %1 \n\t"
|
||||
"movd %%mm4, %2 \n\t"
|
||||
"movd %%mm5, %3 \n\t"
|
||||
:"+m"(*(uint32_t*)(dest+0*linesize)),
|
||||
"+m"(*(uint32_t*)(dest+1*linesize)),
|
||||
"+m"(*(uint32_t*)(dest+2*linesize)),
|
||||
"+m"(*(uint32_t*)(dest+3*linesize))
|
||||
:"+m"(*(uint32_t *)(dest + 0 * stride)),
|
||||
"+m"(*(uint32_t *)(dest + 1 * stride)),
|
||||
"+m"(*(uint32_t *)(dest + 2 * stride)),
|
||||
"+m"(*(uint32_t *)(dest + 3 * stride))
|
||||
);
|
||||
}
|
||||
|
||||
static void vc1_inv_trans_8x4_dc_mmxext(uint8_t *dest, int linesize,
|
||||
static void vc1_inv_trans_8x4_dc_mmxext(uint8_t *dest, ptrdiff_t stride,
|
||||
int16_t *block)
|
||||
{
|
||||
int dc = block[0];
|
||||
@ -631,14 +631,14 @@ static void vc1_inv_trans_8x4_dc_mmxext(uint8_t *dest, int linesize,
|
||||
"movq %%mm3, %1 \n\t"
|
||||
"movq %%mm4, %2 \n\t"
|
||||
"movq %%mm5, %3 \n\t"
|
||||
:"+m"(*(uint32_t*)(dest+0*linesize)),
|
||||
"+m"(*(uint32_t*)(dest+1*linesize)),
|
||||
"+m"(*(uint32_t*)(dest+2*linesize)),
|
||||
"+m"(*(uint32_t*)(dest+3*linesize))
|
||||
:"+m"(*(uint32_t *)(dest + 0 * stride)),
|
||||
"+m"(*(uint32_t *)(dest + 1 * stride)),
|
||||
"+m"(*(uint32_t *)(dest + 2 * stride)),
|
||||
"+m"(*(uint32_t *)(dest + 3 * stride))
|
||||
);
|
||||
}
|
||||
|
||||
static void vc1_inv_trans_8x8_dc_mmxext(uint8_t *dest, int linesize,
|
||||
static void vc1_inv_trans_8x8_dc_mmxext(uint8_t *dest, ptrdiff_t stride,
|
||||
int16_t *block)
|
||||
{
|
||||
int dc = block[0];
|
||||
@ -670,12 +670,12 @@ static void vc1_inv_trans_8x8_dc_mmxext(uint8_t *dest, int linesize,
|
||||
"movq %%mm3, %1 \n\t"
|
||||
"movq %%mm4, %2 \n\t"
|
||||
"movq %%mm5, %3 \n\t"
|
||||
:"+m"(*(uint32_t*)(dest+0*linesize)),
|
||||
"+m"(*(uint32_t*)(dest+1*linesize)),
|
||||
"+m"(*(uint32_t*)(dest+2*linesize)),
|
||||
"+m"(*(uint32_t*)(dest+3*linesize))
|
||||
:"+m"(*(uint32_t *)(dest + 0 * stride)),
|
||||
"+m"(*(uint32_t *)(dest + 1 * stride)),
|
||||
"+m"(*(uint32_t *)(dest + 2 * stride)),
|
||||
"+m"(*(uint32_t *)(dest + 3 * stride))
|
||||
);
|
||||
dest += 4*linesize;
|
||||
dest += 4 * stride;
|
||||
__asm__ volatile(
|
||||
"movq %0, %%mm2 \n\t"
|
||||
"movq %1, %%mm3 \n\t"
|
||||
@ -693,10 +693,10 @@ static void vc1_inv_trans_8x8_dc_mmxext(uint8_t *dest, int linesize,
|
||||
"movq %%mm3, %1 \n\t"
|
||||
"movq %%mm4, %2 \n\t"
|
||||
"movq %%mm5, %3 \n\t"
|
||||
:"+m"(*(uint32_t*)(dest+0*linesize)),
|
||||
"+m"(*(uint32_t*)(dest+1*linesize)),
|
||||
"+m"(*(uint32_t*)(dest+2*linesize)),
|
||||
"+m"(*(uint32_t*)(dest+3*linesize))
|
||||
:"+m"(*(uint32_t *)(dest + 0 * stride)),
|
||||
"+m"(*(uint32_t *)(dest + 1 * stride)),
|
||||
"+m"(*(uint32_t *)(dest + 2 * stride)),
|
||||
"+m"(*(uint32_t *)(dest + 3 * stride))
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -26,18 +26,19 @@
|
||||
#ifndef AVCODEC_X86_XVIDIDCT_H
|
||||
#define AVCODEC_X86_XVIDIDCT_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
void ff_xvid_idct_mmx(short *block);
|
||||
void ff_xvid_idct_mmx_put(uint8_t *dest, int line_size, int16_t *block);
|
||||
void ff_xvid_idct_mmx_add(uint8_t *dest, int line_size, int16_t *block);
|
||||
void ff_xvid_idct_mmx_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block);
|
||||
void ff_xvid_idct_mmx_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block);
|
||||
|
||||
void ff_xvid_idct_mmxext(short *block);
|
||||
void ff_xvid_idct_mmxext_put(uint8_t *dest, int line_size, int16_t *block);
|
||||
void ff_xvid_idct_mmxext_add(uint8_t *dest, int line_size, int16_t *block);
|
||||
void ff_xvid_idct_mmxext_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block);
|
||||
void ff_xvid_idct_mmxext_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block);
|
||||
|
||||
void ff_xvid_idct_sse2(short *block);
|
||||
void ff_xvid_idct_sse2_put(uint8_t *dest, int line_size, short *block);
|
||||
void ff_xvid_idct_sse2_add(uint8_t *dest, int line_size, short *block);
|
||||
void ff_xvid_idct_sse2_put(uint8_t *dest, ptrdiff_t line_size, short *block);
|
||||
void ff_xvid_idct_sse2_add(uint8_t *dest, ptrdiff_t line_size, short *block);
|
||||
|
||||
#endif /* AVCODEC_X86_XVIDIDCT_H */
|
||||
|
@ -494,13 +494,13 @@ void ff_xvid_idct_mmx(short *block)
|
||||
:: "r" (block), "r" (rounder_0), "r" (tab_i_04_mmx), "r" (tg_1_16));
|
||||
}
|
||||
|
||||
void ff_xvid_idct_mmx_put(uint8_t *dest, int line_size, int16_t *block)
|
||||
void ff_xvid_idct_mmx_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
|
||||
{
|
||||
ff_xvid_idct_mmx(block);
|
||||
ff_put_pixels_clamped_mmx(block, dest, line_size);
|
||||
}
|
||||
|
||||
void ff_xvid_idct_mmx_add(uint8_t *dest, int line_size, int16_t *block)
|
||||
void ff_xvid_idct_mmx_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
|
||||
{
|
||||
ff_xvid_idct_mmx(block);
|
||||
ff_add_pixels_clamped_mmx(block, dest, line_size);
|
||||
@ -533,13 +533,13 @@ void ff_xvid_idct_mmxext(short *block)
|
||||
:: "r" (block), "r" (rounder_0), "r" (tab_i_04_xmm), "r" (tg_1_16));
|
||||
}
|
||||
|
||||
void ff_xvid_idct_mmxext_put(uint8_t *dest, int line_size, int16_t *block)
|
||||
void ff_xvid_idct_mmxext_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
|
||||
{
|
||||
ff_xvid_idct_mmxext(block);
|
||||
ff_put_pixels_clamped_mmx(block, dest, line_size);
|
||||
}
|
||||
|
||||
void ff_xvid_idct_mmxext_add(uint8_t *dest, int line_size, int16_t *block)
|
||||
void ff_xvid_idct_mmxext_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
|
||||
{
|
||||
ff_xvid_idct_mmxext(block);
|
||||
ff_add_pixels_clamped_mmx(block, dest, line_size);
|
||||
|
@ -390,13 +390,13 @@ inline void ff_xvid_idct_sse2(short *block)
|
||||
"%eax", "%ecx", "%edx", "%esi", "memory");
|
||||
}
|
||||
|
||||
void ff_xvid_idct_sse2_put(uint8_t *dest, int line_size, short *block)
|
||||
void ff_xvid_idct_sse2_put(uint8_t *dest, ptrdiff_t line_size, short *block)
|
||||
{
|
||||
ff_xvid_idct_sse2(block);
|
||||
ff_put_pixels_clamped_mmx(block, dest, line_size);
|
||||
}
|
||||
|
||||
void ff_xvid_idct_sse2_add(uint8_t *dest, int line_size, short *block)
|
||||
void ff_xvid_idct_sse2_add(uint8_t *dest, ptrdiff_t line_size, short *block)
|
||||
{
|
||||
ff_xvid_idct_sse2(block);
|
||||
ff_add_pixels_clamped_mmx(block, dest, line_size);
|
||||
|
@ -318,13 +318,13 @@ void ff_xvid_idct(int16_t *const in)
|
||||
}
|
||||
}
|
||||
|
||||
static void xvid_idct_put(uint8_t *dest, int line_size, int16_t *block)
|
||||
static void xvid_idct_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
|
||||
{
|
||||
ff_xvid_idct(block);
|
||||
ff_put_pixels_clamped(block, dest, line_size);
|
||||
}
|
||||
|
||||
static void xvid_idct_add(uint8_t *dest, int line_size, int16_t *block)
|
||||
static void xvid_idct_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
|
||||
{
|
||||
ff_xvid_idct(block);
|
||||
ff_add_pixels_clamped(block, dest, line_size);
|
||||
|
Loading…
Reference in New Issue
Block a user