[FFmpeg-devel] [PATCH 7/7] Moved contitional inline asm into a macro to cleanup code
Michael Niedermayer
michaelni at gmx.at
Sat Mar 28 03:11:14 CET 2015
On Fri, Mar 27, 2015 at 04:51:48PM -0400, Tucker DiNapoli wrote:
> From: Tucker DiNapoli <T.DiNapoli42 at gmail.com>
>
> ---
> libpostproc/postprocess.c | 2 +-
> libpostproc/postprocess_template.c | 41 ++++++++++++++++++++++++--------------
> 2 files changed, 27 insertions(+), 16 deletions(-)
that inline asm should go away ideally not be moved around
>
> diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c
> index 9d89782..b8740db 100644
> --- a/libpostproc/postprocess.c
> +++ b/libpostproc/postprocess.c
> @@ -117,7 +117,7 @@ const char *postproc_license(void)
> #define OPTIONS_ARRAY_SIZE 10
> #define BLOCK_SIZE 8
> #define TEMP_STRIDE 8
> -//#define NUM_BLOCKS_AT_ONCE 16 //not used yet
> +#define BLOCKS_PER_ITERATION 1 //1 for now to keep old code working
>
> #if ARCH_X86 && HAVE_INLINE_ASM
> DECLARE_ASM_CONST(8, uint64_t, w05)= 0x0005000500050005LL;
> diff --git a/libpostproc/postprocess_template.c b/libpostproc/postprocess_template.c
> index 794ea17..34c1cc1 100644
> --- a/libpostproc/postprocess_template.c
> +++ b/libpostproc/postprocess_template.c
> @@ -1449,7 +1449,11 @@ DERING_CORE((%0, %1, 8) ,(%%REGd, %1, 4),%%mm2,%%mm4,%%mm0,%%mm3,%%mm5,%%mm1,
> */
> static inline void RENAME(deInterlaceInterpolateLinear)(uint8_t src[], int stride)
> {
> + int block_index;
> + uint8_t *src_base = src;
> + for(block_index=0;block_index<BLOCKS_PER_ITERATION; block_index++){
> #if TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW
> + src = src_base;
> src+= 4*stride;
> __asm__ volatile(
> "lea (%0, %1), %%"REG_a" \n\t"
> @@ -1476,6 +1480,7 @@ static inline void RENAME(deInterlaceInterpolateLinear)(uint8_t src[], int strid
> );
> #else
> int a, b, x;
> + src = src_base;
> src+= 4*stride;
>
> for(x=0; x<2; x++){
> @@ -1491,6 +1496,8 @@ static inline void RENAME(deInterlaceInterpolateLinear)(uint8_t src[], int strid
> src += 4;
> }
> #endif
> + src_base += 8;
> + }
> }
deinterlace should be applied linewise, not blockwise if you
want to optimize it, its not a block based operation
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150328/f9ed0880/attachment.asc>
More information about the ffmpeg-devel
mailing list