You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
postproc/postprocess_template: Use immediate instead of memory load
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@ -95,6 +95,8 @@ try to unroll inner for(x=0 ... loop to avoid these damn if(x ... checks
|
|||||||
#define TEMP_STRIDE 8
|
#define TEMP_STRIDE 8
|
||||||
//#define NUM_BLOCKS_AT_ONCE 16 //not used yet
|
//#define NUM_BLOCKS_AT_ONCE 16 //not used yet
|
||||||
|
|
||||||
|
#define DERING_THRESHOLD 20
|
||||||
|
|
||||||
#if ARCH_X86 && HAVE_INLINE_ASM
|
#if ARCH_X86 && HAVE_INLINE_ASM
|
||||||
DECLARE_ASM_CONST(8, uint64_t, w05)= 0x0005000500050005LL;
|
DECLARE_ASM_CONST(8, uint64_t, w05)= 0x0005000500050005LL;
|
||||||
DECLARE_ASM_CONST(8, uint64_t, w04)= 0x0004000400040004LL;
|
DECLARE_ASM_CONST(8, uint64_t, w04)= 0x0004000400040004LL;
|
||||||
@ -105,9 +107,6 @@ DECLARE_ASM_CONST(8, uint64_t, b08)= 0x0808080808080808LL;
|
|||||||
DECLARE_ASM_CONST(8, uint64_t, b80)= 0x8080808080808080LL;
|
DECLARE_ASM_CONST(8, uint64_t, b80)= 0x8080808080808080LL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DECLARE_ASM_CONST(8, int, deringThreshold)= 20;
|
|
||||||
|
|
||||||
|
|
||||||
static const struct PPFilter filters[]=
|
static const struct PPFilter filters[]=
|
||||||
{
|
{
|
||||||
{"hb", "hdeblock", 1, 1, 3, H_DEBLOCK},
|
{"hb", "hdeblock", 1, 1, 3, H_DEBLOCK},
|
||||||
|
@ -573,7 +573,7 @@ static inline void dering_altivec(uint8_t src[], int stride, PPContext *c) {
|
|||||||
src & stride :-(
|
src & stride :-(
|
||||||
*/
|
*/
|
||||||
uint8_t *srcCopy = src;
|
uint8_t *srcCopy = src;
|
||||||
DECLARE_ALIGNED(16, uint8_t, dt)[16] = { deringThreshold };
|
DECLARE_ALIGNED(16, uint8_t, dt)[16] = { DERING_THRESHOLD };
|
||||||
const vector signed int zero = vec_splat_s32(0);
|
const vector signed int zero = vec_splat_s32(0);
|
||||||
vector unsigned char v_dt = vec_splat(vec_ld(0, dt), 0);
|
vector unsigned char v_dt = vec_splat(vec_ld(0, dt), 0);
|
||||||
|
|
||||||
|
@ -888,7 +888,7 @@ FIND_MIN_MAX((%0, %1, 8))
|
|||||||
"psubb %%mm7, %%mm6 \n\t" // max - min
|
"psubb %%mm7, %%mm6 \n\t" // max - min
|
||||||
"push %%"FF_REG_a" \n\t"
|
"push %%"FF_REG_a" \n\t"
|
||||||
"movd %%mm6, %%eax \n\t"
|
"movd %%mm6, %%eax \n\t"
|
||||||
"cmpb "MANGLE(deringThreshold)", %%al \n\t"
|
"cmpb $"AV_STRINGIFY(DERING_THRESHOLD)", %%al \n\t"
|
||||||
"pop %%"FF_REG_a" \n\t"
|
"pop %%"FF_REG_a" \n\t"
|
||||||
" jb 1f \n\t"
|
" jb 1f \n\t"
|
||||||
PAVGB(%%mm0, %%mm7) // a=(max + min)/2
|
PAVGB(%%mm0, %%mm7) // a=(max + min)/2
|
||||||
@ -1017,7 +1017,7 @@ DERING_CORE((%0, %1, 8) ,(%%FF_REGd, %1, 4),%%mm2,%%mm4,%%mm0,%%mm3,%%mm5,
|
|||||||
|
|
||||||
"1: \n\t"
|
"1: \n\t"
|
||||||
: : "r" (src), "r" ((x86_reg)stride), "m" (c->pQPb), "m"(c->pQPb2), "q"(tmp)
|
: : "r" (src), "r" ((x86_reg)stride), "m" (c->pQPb), "m"(c->pQPb2), "q"(tmp)
|
||||||
NAMED_CONSTRAINTS_ADD(deringThreshold,b00,b08)
|
NAMED_CONSTRAINTS_ADD(b00,b08)
|
||||||
: "%"FF_REG_a, "%"FF_REG_d
|
: "%"FF_REG_a, "%"FF_REG_d
|
||||||
);
|
);
|
||||||
#else // HAVE_7REGS && TEMPLATE_PP_MMXEXT
|
#else // HAVE_7REGS && TEMPLATE_PP_MMXEXT
|
||||||
@ -1041,7 +1041,7 @@ DERING_CORE((%0, %1, 8) ,(%%FF_REGd, %1, 4),%%mm2,%%mm4,%%mm0,%%mm3,%%mm5,
|
|||||||
}
|
}
|
||||||
avg= (min + max + 1)>>1;
|
avg= (min + max + 1)>>1;
|
||||||
|
|
||||||
if(max - min <deringThreshold) return;
|
if (max - min < DERING_THRESHOLD) return;
|
||||||
|
|
||||||
for(y=0; y<10; y++){
|
for(y=0; y<10; y++){
|
||||||
int t = 0;
|
int t = 0;
|
||||||
|
Reference in New Issue
Block a user