• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

libavcodec/x86/dnxhd_mmx.c

Go to the documentation of this file.
00001 /*
00002  * VC3/DNxHD SIMD functions
00003  * Copyright (c) 2007 Baptiste Coudurier <baptiste dot coudurier at smartjog dot com>
00004  *
00005  * VC-3 encoder funded by the British Broadcasting Corporation
00006  *
00007  * This file is part of FFmpeg.
00008  *
00009  * FFmpeg is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU Lesser General Public
00011  * License as published by the Free Software Foundation; either
00012  * version 2.1 of the License, or (at your option) any later version.
00013  *
00014  * FFmpeg is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017  * Lesser General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU Lesser General Public
00020  * License along with FFmpeg; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00022  */
00023 
00024 #include "libavutil/x86_cpu.h"
00025 #include "libavcodec/dnxhdenc.h"
00026 
00027 static void get_pixels_8x4_sym_sse2(DCTELEM *block, const uint8_t *pixels, int line_size)
00028 {
00029     __asm__ volatile(
00030         "pxor %%xmm7,      %%xmm7       \n\t"
00031         "movq (%0),        %%xmm0       \n\t"
00032         "add  %2,          %0           \n\t"
00033         "movq (%0),        %%xmm1       \n\t"
00034         "movq (%0, %2),    %%xmm2       \n\t"
00035         "movq (%0, %2,2),  %%xmm3       \n\t"
00036         "punpcklbw %%xmm7, %%xmm0       \n\t"
00037         "punpcklbw %%xmm7, %%xmm1       \n\t"
00038         "punpcklbw %%xmm7, %%xmm2       \n\t"
00039         "punpcklbw %%xmm7, %%xmm3       \n\t"
00040         "movdqa %%xmm0,      (%1)       \n\t"
00041         "movdqa %%xmm1,    16(%1)       \n\t"
00042         "movdqa %%xmm2,    32(%1)       \n\t"
00043         "movdqa %%xmm3,    48(%1)       \n\t"
00044         "movdqa %%xmm3 ,   64(%1)       \n\t"
00045         "movdqa %%xmm2 ,   80(%1)       \n\t"
00046         "movdqa %%xmm1 ,   96(%1)       \n\t"
00047         "movdqa %%xmm0,   112(%1)       \n\t"
00048         : "+r" (pixels)
00049         : "r" (block), "r" ((x86_reg)line_size)
00050     );
00051 }
00052 
00053 void ff_dnxhd_init_mmx(DNXHDEncContext *ctx)
00054 {
00055     if (mm_flags & FF_MM_SSE2) {
00056         ctx->get_pixels_8x4_sym = get_pixels_8x4_sym_sse2;
00057     }
00058 }

Generated on Fri Sep 16 2011 17:17:46 for FFmpeg by  doxygen 1.7.1