[FFmpeg-devel] [PATCH] Port x264 SSE2 deblocking code to H.264 decoder

Michael Niedermayer michaelni
Wed Dec 17 01:44:08 CET 2008


On Tue, Dec 16, 2008 at 01:10:28PM -0800, Jason Garrett-Glaser wrote:
> $subject.

:))))))))))))))))))))))))))))
i was already afraid you would never port the stuff.

Anyway, my comments are not about the patch, that as such looks fine.
The problem is that this file does not match x264, and thus would make
future synchronization between ffmpeg and x264 painfull.

lets see:

> --- deblock-a.asm	2008-12-17 01:30:53.000000000 +0100
> +++ h264_deblock_sse2.asm	2008-12-17 01:30:17.000000000 +0100
> @@ -1,24 +1,23 @@
> -;*****************************************************************************
> -;* deblock-a.asm: h264 encoder library
> -;*****************************************************************************
> -;* Copyright (C) 2005-2008 x264 project
> +;******************************************************************************
> +;* SSE2 optimized H.264 deblocking
> +;* Copyright (c) 2005-2008 Loren Merritt
>  ;*
> -;* Authors: Loren Merritt <lorenm at u.washington.edu>
> +;* This file is part of FFmpeg.
>  ;*
> -;* This program is free software; you can redistribute it and/or modify
> -;* it under the terms of the GNU General Public License as published by
> -;* the Free Software Foundation; either version 2 of the License, or
> -;* (at your option) any later version.
> +;* FFmpeg is free software; you can redistribute it and/or
> +;* modify it under the terms of the GNU General Public
> +;* License as published by the Free Software Foundation; either
> +;* version 2 of the License, or (at your option) any later version.
>  ;*
> -;* This program is distributed in the hope that it will be useful,
> +;* FFmpeg is distributed in the hope that it will be useful,
>  ;* but WITHOUT ANY WARRANTY; without even the implied warranty of
> -;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> -;* GNU General Public License for more details.
> +;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +;* General Public License for more details.
>  ;*
> -;* You should have received a copy of the GNU General Public License
> -;* along with this program; if not, write to the Free Software
> -;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111, USA.
> -;*****************************************************************************
> +;* You should have received a copy of the GNU General Public
> +;* License along with FFmpeg; if not, write to the Free Software
> +;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> +;******************************************************************************

I belive that whatever license header this file shall carry, it should not
differ between the file in x264 and ffmpeg.


>  
>  %include "x86inc.asm"
>  
> @@ -28,7 +27,7 @@
>  pb_03: times 16 db 0x03
>  pb_a1: times 16 db 0xa1
>  
> -SECTION .text
> +section .text align=16


why?


>  
>  ; expands to [base],...,[base+7*stride]
>  %define PASS8ROWS(base, base3, stride, stride3) \
> @@ -275,10 +274,10 @@
>  
>  %ifdef ARCH_X86_64
>  ;-----------------------------------------------------------------------------
> -; void x264_deblock_v_luma_sse2( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 )
> +; void h264_v_loop_filter_luma_sse2( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 )
>  ;-----------------------------------------------------------------------------
>  INIT_XMM
> -cglobal x264_deblock_v_luma_sse2
> +cglobal h264_v_loop_filter_luma_sse2
>      movd    m8, [r4] ; tc0
>      lea     r4, [r1*3]
>      dec     r2d        ; alpha-1

would it be possible to use some kind of macro to give these functions
differnt prefixes so the .asm files could be identical?


[...]
> @@ -481,392 +480,7 @@
>      RET
>  %endmacro ; DEBLOCK_LUMA
>  
> -INIT_MMX
> -DEBLOCK_LUMA mmxext, v8, 8
>  INIT_XMM
>  DEBLOCK_LUMA sse2, v, 16
>  
>  %endif ; ARCH
> -
> -
> -
> -%macro LUMA_INTRA_P012 4 ; p0..p3 in memory
> -    mova  t0, p2
> -    mova  t1, p0
> -    pavgb t0, p1
> -    pavgb t1, q0
> -    pavgb t0, t1 ; ((p2+p1+1)/2 + (p0+q0+1)/2 + 1)/2
> -    mova  t5, t1
> -    mova  t2, p2
> -    mova  t3, p0
...

why is all this code ommited?

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081217/9bd934af/attachment.pgp>



More information about the ffmpeg-devel mailing list