Commit 5dc0aae2 authored by Laurent Aimar's avatar Laurent Aimar

* all: re-import of the CVS.


git-svn-id: svn://svn.videolan.org/x264/trunk@1 df754926-b1dd-0310-bc7b-ec298dee348c
parents
.depend
x264
checkasm
# $Id: AUTHORS,v 1.1 2004/06/03 19:27:06 fenrir Exp $
#
# The format of this file was inspired by the Linux kernel CREDITS file.
# Authors are listed alphabetically.
#
# The fields are: name (N), email (E), web-address (W), CVS account login (C),
# PGP key ID and fingerprint (P), description (D), and snail-mail address (S).
N: Laurent Aimar
E: fenrir AT via.ecp DOT fr
C: fenrir
D: Intial import, maintainer
D: i386 asm (mmx/mmx2)
S: France
N: Eric Petit
E: titer AT videolan DOT org
C: titer
D: Altivec
D: BeOS and MacOS X ports.
S: France
N: Min Chen
E: chenm001 AT 163 DOT com
C: chenm001
D: Win32/VC 6.0 port
D: gcc asm to nasm conversion
D: vfw interface
S: China
N: Justin Clay
E: justin_clay AT hotmail DOT com
C: wheatgerm
D: Inital work on vfw
S: Nova Scotia, Canada
This diff is collapsed.
# $Id: Jamfile,v 1.1 2004/06/03 19:27:06 fenrir Exp $
#
# Compilers
CC = gcc ;
AS = nasm ;
# Flags
# To profile: -fprofile-arcs
# Once done : -fbranch-probabilities
CCFLAGS = -g -Wall -W ;
# Globals defines
DEFINES = DEBUG __X264__ ;
# Optims
OPTIM = -O3 -funroll-loops ;
# Headers rep
HDRS = . core core/i366 decoder encoder ;
SOURCES_C = core/mc.c core/predict.c core/pixel.c core/macroblock.c
core/frame.c core/dct.c core/cpu.c core/cabac.c
core/common.c core/mdate.c core/csp.c
encoder/analyse.c encoder/me.c encoder/ratecontrol.c
encoder/set.c encoder/macroblock.c encoder/cabac.c encoder/cavlc.c
encoder/encoder.c ;
SOURCES_X86 = core/i386/cpu.asm ;
SOURCES_MMX = core/i386/mc-c.c core/i386/dct-c.c core/i386/predict.c core/i386/dct.asm core/i386/pixel.asm core/i386/mc.asm ;
SOURCES_ALTIVEC = core/ppc/mc.c core/ppc/pixel.c ;
# libx264
SOURCES_X264 = $(SOURCES_C) ;
if $(OS) = LINUX
{
DEFINES += ARCH_X86 HAVE_MMXEXT HAVE_MALLOC_H ;
SOURCES_X264 += $(SOURCES_MMX) ;
SOURCES_X264 += $(SOURCES_X86) ;
ASFLAGS = -f elf ;
# Don't ask why
NOARUPDATE = false ;
}
if $(OS) = MACOSX
{
DEFINES += HAVE_ALTIVEC ;
SOURCES_X264 += $(SOURCES_ALTIVEC) ;
CCFLAGS += -faltivec ;
# OPTIM += -falign-loops=16 ;
}
Library libx264 : $(SOURCES_X264) ;
# x264
LINKLIBS += -lm ;
LinkLibraries x264 : libx264.a ;
Main x264 : x264.c ;
# checkasm
LinkLibraries checkasm : libx264.a ;
Main checkasm : testing/checkasm.c ;
# XXX Do not remove *.o files
actions quietly updated piecemeal together RmTemps
{
}
# Makefile: tuned for i386/MMX system only
# For ppc append
# SRCS: core/ppc/mc.c core/ppc/pixel.c
# Defines: HAVE_ALTIVEC
# CFLAGS: -faltivec
#
CC=gcc
CFLAGS=-g -Wall -I. -DDEBUG -O4 -funroll-loops -D__X264__ -DHAVE_MALLOC_H -DHAVE_MMXEXT -DARCH_X86
SRCS= core/mc.c core/predict.c core/pixel.c core/macroblock.c \
core/frame.c core/dct.c core/cpu.c core/cabac.c \
core/common.c core/mdate.c core/csp.c \
encoder/analyse.c encoder/me.c encoder/ratecontrol.c \
encoder/set.c encoder/macroblock.c encoder/cabac.c encoder/cavlc.c \
encoder/encoder.c \
core/i386/mc-c.c core/i386/dct-c.c core/i386/predict.c \
x264.c
AS= nasm
# for linux
ASFLAGS=-f elf
# for cygwin
#ASFLAGS=-f gnuwin32 -DPREFIX
ASMSRC= core/i386/dct.asm core/i386/cpu.asm core/i386/pixel.asm core/i386/mc.asm
OBJASM= $(ASMSRC:%.asm=%.o)
OBJS = $(SRCS:%.c=%.o)
DEP = depend
default: $(DEP) x264
libx264.a: $(OBJS) $(OBJASM)
ar rc libx264.a $(OBJS) $(OBJASM)
x264: libx264.a x264.o
$(CC) $(CFLAGS) -o x264 x264.o libx264.a -lm
checkasm: testing/checkasm.c libx264.a
$(CC) $(CFLAGS) -o checkasm $< libx264.a -lm
%.o: %.asm
$(AS) $(ASFLAGS) -o $@ $<
.depend: $(SRCS) x264.c
$(CC) -MM $(CFLAGS) $(SRCS) x264.c 1> .depend
depend: .depend
ifneq ($(wildcard .depend),)
include .depend
endif
clean:
rm -f $(OBJS) $(OBJASM) *.a x264.o .depend x264
distclean:
rm -f $(OBJS) $(OBJASM) *.a x264.o .depend x264
# Makefile: tuned for i386/MMX cygwin system only
#
CC=gcc
CFLAGS=-g -Wall -I. -mno-cygwin -DDEBUG -O4 -funroll-loops -D__X264__ -UHAVE_MALLOC_H -DHAVE_MMXEXT -DARCH_X86
SRCS= core/mc.c core/predict.c core/pixel.c core/macroblock.c \
core/frame.c core/dct.c core/cpu.c core/cabac.c \
core/common.c core/mdate.c core/csp.c \
encoder/analyse.c encoder/me.c encoder/ratecontrol.c \
encoder/set.c encoder/macroblock.c encoder/cabac.c encoder/cavlc.c \
encoder/encoder.c \
core/i386/mc-c.c core/i386/dct-c.c core/i386/predict.c \
x264.c
AS= nasm
#for cygwin
ASFLAGS=-f win32 -DPREFIX
ASMSRC= core/i386/dct.asm core/i386/cpu.asm core/i386/pixel.asm core/i386/mc.asm
OBJASM= $(ASMSRC:%.asm=%.o)
OBJS = $(SRCS:%.c=%.o)
DEP = depend
default: $(DEP) x264
libx264.a: $(OBJS) $(OBJASM)
ar rc libx264.a $(OBJS) $(OBJASM)
x264: libx264.a x264.o
$(CC) $(CFLAGS) -o x264 x264.o libx264.a -lm
checkasm: testing/checkasm.c libx264.a
$(CC) $(CFLAGS) -o checkasm $< libx264.a -lm
%.o: %.asm
$(AS) $(ASFLAGS) -o $@ $<
.depend: $(SRCS) x264.c
$(CC) -MM $(CFLAGS) $(SRCS) x264.c 1> .depend
depend: .depend
ifneq ($(wildcard .depend),)
include .depend
endif
clean:
rm -f $(OBJS) $(OBJASM) *.a x264.o .depend x264
distclean:
rm -f $(OBJS) $(OBJASM) *.a x264.o .depend x264
It is far from complete, anyway :
General:
--------
Encoder:
########
* CABAC: check if adaptive model is really working. (I didn't see any improvments)
* Field support : no and I probably won't do it.
* Slice A/B/C (partion): is there any interest doing it ? (Shouldn't be hard).
- extend x264_t
- review x264_macroblock_write_cavlc
* Intra encoding:
- in I_4x4 mode, some predict mode aren't tested and not supported :
when some pixels around are unavailble but could be predicted from
others. (see the norm)
* Inter coding:
- D_4x8 D_8x4 and D_4x4 ME P block -> done but too slow.
- B_ types.
- scene change detection.
- long terme ?
- ...
* B frame: B_L0/L1/BI work in cavlc (need more testing).
-> need to do all others mb type (first B_DIRECT and B_SKIP)
-> cabac
-> look at weighted prediction (should give bettter result)
-> better analyse algo (as always ;)
* Speed issue (oprofile is your friend)
- mc.c:30% and pixel.c:20% (mc is used by ME)
- Motion Estimation -> try better/faster algos.
- loop filter
- stream writing (bs)
- ...
* Time spent: (test file: 720x576, mmx, mmxext)
CAVLC: analyse=73% encode=15% write=4% filter=6%
CABAC: analyse=69% encode=16% write=8% filter=5%
* Limitations:
- frame width/height %16 == 0 only.
* ...
Decoder:
########
* Currently decoder/* won't even compile, and anyway is unusable.
Build:
######
* Port gcc inlined asm to nasm file (BUT without any speed loss else
that will be rejected).
Coding issue:
-------------
* table : somes are duplicated -> find a solution (easy).
* documentations ? (mouaaaarfff ;)
* ...
##############################################################################
#
# Makefile for lib264.a and x264
#
# Author: x264 by Laurent Aimar <fenrir@via.ecp.fr>
#
# $Id: Makefile,v 1.1 2004/06/03 19:27:06 fenrir Exp $
##############################################################################
# Current dir
DIR_CUR=$(shell pwd)
# Path to src
DIR_SRC=$(DIR_CUR)/../..
# Sources
SRC_C= core/mc.c core/predict.c core/pixel.c core/macroblock.c \
core/frame.c core/dct.c core/cpu.c core/cabac.c \
core/common.c core/mdate.c core/csp.c \
encoder/analyse.c encoder/me.c encoder/ratecontrol.c \
encoder/set.c encoder/macroblock.c encoder/cabac.c encoder/cavlc.c \
encoder/encoder.c \
core/i386/mc-c.c core/i386/dct-c.c core/i386/predict.c
SRC_ASM= core/i386/dct.asm core/i386/cpu.asm core/i386/pixel.asm core/i386/mc.asm
# Alias
RM= rm -rf
##############################################################################
# CFLAGS
##############################################################################
# Constants which should not be modified
# The `mingw-runtime` package is required when building with -mno-cygwin
CFLAGS += -I$(DIR_SRC)
CFLAGS += -mno-cygwin
CFLAGS += -D__X264__ -DARCH_X86 -DHAVE_MMXEXT -D_CYGWIN
# Optional Compiler options
CFLAGS += -g -Wall -DDEBUG
CFLAGS += -O3
CFLAGS += -finline-functions
CFLAGS += -funroll-loops
CFLAGS += -ffast-math
##############################################################################
# Compiler flags for linking stage
##############################################################################
LDFLAGS += -L$(DIR_LIB) -lx264
##############################################################################
# ASM
##############################################################################
AS= nasm
ASFLAGS= -f gnuwin32 -DPREFIX
##############################################################################
# Rules
##############################################################################
OBJECTS = $(SRC_C:.c=.obj)
OBJECTS+= $(SRC_ASM:.asm=.obj)
.SUFFIXES: .obj .asm .c
DIR_BUILD= $(DIR_CUR)/bin
VPATH = $(DIR_SRC):$(DIR_BUILD)
all: libx264.a x264.exe
$(DIR_BUILD):
@echo " D: $(DIR_BUILD)"
@mkdir -p $(DIR_BUILD)
.asm.obj:
@echo " A: $(@D)/$(<F)"
@mkdir -p $(DIR_BUILD)/$(@D)
@$(AS) $(ASFLAGS) -o $(DIR_BUILD)/$@ $<
.c.obj:
@echo " C: $(@D)/$(<F)"
@mkdir -p $(DIR_BUILD)/$(@D)
@$(CC) $(CFLAGS) -c -o $(DIR_BUILD)/$@ $<
libx264.a: $(DIR_BUILD) $(OBJECTS)
@echo " L: $(@F)"
@cd $(DIR_BUILD) && \
ar rc libx264.a $(OBJECTS) && \
cp -f libx264.a $(DIR_SRC)
x264.exe: $(DIR_BUILD) $(OBJECTS) x264.obj
@echo " L: $(@F)"
@cd $(DIR_BUILD) && \
$(CC) $(CFLAGS) -o x264 x264.obj libx264.a -lm && \
cp -f x264.exe $(DIR_SRC)
clean:
@echo " Cl: Object files and target lib"
@$(RM) $(DIR_BUILD)
This diff is collapsed.
# Microsoft Developer Studio Project File - Name="x264" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=x264 - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "x264.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "x264.mak" CFG="x264 - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "x264 - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "x264 - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "x264 - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "obj/x264_Release"
# PROP Intermediate_Dir "obj/x264_Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /I "./core" /I "./encode" /I "./decode" /I "../../extras" /I "../.." /D "NDEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "__X264__" /D "HAVE_MMXEXT" /YX /FD /c
# ADD BASE RSC /l 0x804 /d "NDEBUG"
# ADD RSC /l 0x804 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"bin/x264.exe"
!ELSEIF "$(CFG)" == "x264 - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "obj/x264_Debug"
# PROP Intermediate_Dir "obj/x264_Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "../../core" /I "../../encode" /I "../../decode" /I "../../extras" /I "../.." /D "_DEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "__X264__" /D "HAVE_MMXEXT" /YX /FD /GZ /c
# ADD BASE RSC /l 0x804 /d "_DEBUG"
# ADD RSC /l 0x804 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"bin/x264.exe" /pdbtype:sept
!ENDIF
# Begin Target
# Name "x264 - Win32 Release"
# Name "x264 - Win32 Debug"
# Begin Source File
SOURCE=..\..\x264.c
# End Source File
# Begin Source File
SOURCE=..\..\x264.h
# End Source File
# End Target
# End Project
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "libx264"=.\libx264.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "x264"=.\x264.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name libx264
End Project Dependency
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################
This diff is collapsed.
This diff is collapsed.
/*****************************************************************************
* cabac.h: h264 encoder library
*****************************************************************************
* Copyright (C) 2003 Laurent Aimar
* $Id: cabac.h,v 1.1 2004/06/03 19:27:06 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* 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.
*
* This program 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.
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#ifndef _CABAC_H
#define _CABAC_H 1
typedef struct
{
/* model */
struct
{
int i_model;
int i_cost;
} slice[3];
/* context */
struct
{
int i_state;
int i_mps;
int i_count;
} ctxstate[399];
/* state */
int i_low;
int i_range;
int i_sym_cnt;
/* bit stream */
int b_first_bit;
int i_bits_outstanding;
bs_t *s;
} x264_cabac_t;
/* encoder/decoder: init the contexts given i_slice_type, the quantif and the model */
void x264_cabac_context_init( x264_cabac_t *cb, int i_slice_type, int i_qp, int i_model );
/* decoder only: */
void x264_cabac_decode_init ( x264_cabac_t *cb, bs_t *s );
int x264_cabac_decode_decision( x264_cabac_t *cb, int i_ctx_idx );
int x264_cabac_decode_bypass ( x264_cabac_t *cb );
int x264_cabac_decode_terminal( x264_cabac_t *cb );
/* encoder only: adaptive model init */
void x264_cabac_model_init( x264_cabac_t *cb );
int x264_cabac_model_get ( x264_cabac_t *cb, int i_slice_type );
void x264_cabac_model_update( x264_cabac_t *cb, int i_slice_type, int i_qp );
/* encoder only: */
void x264_cabac_encode_init ( x264_cabac_t *cb, bs_t *s );
void x264_cabac_encode_decision( x264_cabac_t *cb, int i_ctx_idx, int b );
void x264_cabac_encode_bypass( x264_cabac_t *cb, int b );
void x264_cabac_encode_terminal( x264_cabac_t *cb, int b );
void x264_cabac_encode_flush( x264_cabac_t *cb );
#endif
/*****************************************************************************
* clip1.h: h264 encoder library
*****************************************************************************
* Copyright (C) 2003 Laurent Aimar
* $Id: clip1.h,v 1.1 2004/06/03 19:27:06 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* 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.
*
* This program 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.
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#ifndef _CLIP1_H
#define _CLIP1_H 1
/* Clip1 table
* XXX : only for tap filter.
*
* With tap filter (( 1, -5, 20, 20, -5, 1 ) + 16 )/ 32
* -> (-2*5 * 255+16)/32 <= out <= (2*1*255 + 2*20*255+16)/32
* -> -80 <= out <= 335
* So we need a table of 80+335+1 = 416 entries
*/
static const uint8_t x264_mc_clip1_table[80+1+335] =
{
/* -80 -> -1 */
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,
/* 0 -> 255 */
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,101,102,103,104,105,106,107,
108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,
126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,
162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,
180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,
198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,
216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,
234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,
252,253,254,255,
/* 256 -> 340 */
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,
};
static inline uint8_t x264_mc_clip1( int x )
{
return x264_mc_clip1_table[x+80];
}
#endif
/*****************************************************************************
* common.c: h264 library
*****************************************************************************
* Copyright (C) 2003 Laurent Aimar
* $Id: common.c,v 1.1 2004/06/03 19:27:06 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* 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.
*
* This program 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.
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
#include "common.h"
#include "cpu.h"
/****************************************************************************
* x264_param_default:
****************************************************************************/
void x264_param_default( x264_param_t *param )
{
/* */
memset( param, 0, sizeof( x264_param_t ) );
/* CPU autodetect */