[FFmpeg-devel] [PATCH 1/4] dsputil: make square put/avg_pixels functions local to h264qpel.

Michael Niedermayer michaelni at gmx.at
Tue Mar 5 19:55:27 CET 2013


On Tue, Mar 05, 2013 at 09:34:46AM -0800, Ronald S. Bultje wrote:
> Hi,
> 
> On Mon, Mar 4, 2013 at 11:19 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Sun, Mar 03, 2013 at 03:47:09PM -0800, Ronald S. Bultje wrote:
> >> From: "Ronald S. Bultje" <rsbultje at gmail.com>
> >>
> >> Put a copy of the 8bit functions only in dsputil, where they are used
> >> for some other things (e.g. mpeg4qpel, mspel, cavsqpel). We could perhaps
> >> also try to share specifically the 8bit functions from h264qpel between
> >> it and the others, but that will be slightly more complicated.
> >> ---
> > [...]
> >
> >> diff --git a/libavcodec/h264qpel_template.c b/libavcodec/h264qpel_template.c
> >> index 95950f4..88adb15 100644
> >> --- a/libavcodec/h264qpel_template.c
> >> +++ b/libavcodec/h264qpel_template.c
> >> @@ -532,29 +532,42 @@ H264_MC(avg_, 16)
> >>  #undef op2_avg
> >>  #undef op2_put
> >>
> >> +static void FUNCC(put_pixels8x8)(uint8_t *dst, uint8_t *src, int stride) {
> >> +  FUNCC(put_pixels8)(dst, src, stride, 8);
> >> +}
> >> +static void FUNCC(avg_pixels8x8)(uint8_t *dst, uint8_t *src, int stride) {
> >> +  FUNCC(avg_pixels8)(dst, src, stride, 8);
> >> +}
> >> +static void FUNCC(put_pixels16x16)(uint8_t *dst, uint8_t *src, int stride) {
> >> +  FUNCC(put_pixels16)(dst, src, stride, 16);
> >> +}
> >> +static void FUNCC(avg_pixels16x16)(uint8_t *dst, uint8_t *src, int stride) {
> >> +  FUNCC(avg_pixels16)(dst, src, stride, 16);
> >> +}
> >> +
> >>  #if BIT_DEPTH == 8
> >> -#   define put_h264_qpel8_mc00_8_c  ff_put_pixels8x8_8_c
> >> -#   define avg_h264_qpel8_mc00_8_c  ff_avg_pixels8x8_8_c
> >> -#   define put_h264_qpel16_mc00_8_c ff_put_pixels16x16_8_c
> >> -#   define avg_h264_qpel16_mc00_8_c ff_avg_pixels16x16_8_c
> >> +#   define put_h264_qpel8_mc00_8_c  put_pixels8x8_8_c
> >> +#   define avg_h264_qpel8_mc00_8_c  avg_pixels8x8_8_c
> >> +#   define put_h264_qpel16_mc00_8_c put_pixels16x16_8_c
> >> +#   define avg_h264_qpel16_mc00_8_c avg_pixels16x16_8_c
> >>  #elif BIT_DEPTH == 9
> >> -#   define put_h264_qpel8_mc00_9_c  ff_put_pixels8x8_9_c
> >> -#   define avg_h264_qpel8_mc00_9_c  ff_avg_pixels8x8_9_c
> >> -#   define put_h264_qpel16_mc00_9_c ff_put_pixels16x16_9_c
> >> -#   define avg_h264_qpel16_mc00_9_c ff_avg_pixels16x16_9_c
> >> +#   define put_h264_qpel8_mc00_9_c  put_pixels8x8_9_c
> >> +#   define avg_h264_qpel8_mc00_9_c  avg_pixels8x8_9_c
> >> +#   define put_h264_qpel16_mc00_9_c put_pixels16x16_9_c
> >> +#   define avg_h264_qpel16_mc00_9_c avg_pixels16x16_9_c
> >
> > are these defines still needed after duplicating the functions ?
> 
> You mean you'd prefer me to just call the functions
> avg/put_h264_qpel8/16_mc00_{8-14}_c instead of
> put/avg_pixels_1616/8x8_{8-14}_c? (Asking to prevent me from sending a
> patch that does something you didn't mean.)

if such renaming avoids the define (i didnt check if that would work
out) and thus make ths code simpler, yes
if it doesnt end simpler then no point in changing ...

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

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130305/ac01b6f4/attachment.asc>


More information about the ffmpeg-devel mailing list