mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-25 13:18:22 +01:00
create a libwebputils under src/utils
with bit_reader bit_writer and thread for now. Change-Id: If961933fcfc43e60220913fe4d527230ba8f46bb
This commit is contained in:
parent
ee697d9fc9
commit
b112e83647
@ -3,7 +3,6 @@ LOCAL_PATH:= $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_SRC_FILES := \
|
||||
src/dec/alpha.c \
|
||||
src/dec/bits.c \
|
||||
src/dec/dsp.c \
|
||||
src/dec/frame.c \
|
||||
src/dec/idec.c \
|
||||
@ -14,7 +13,6 @@ LOCAL_SRC_FILES := \
|
||||
src/dec/webp.c \
|
||||
src/dec/io.c \
|
||||
src/dec/buffer.c \
|
||||
src/dec/thread.c \
|
||||
src/dsp/yuv.c \
|
||||
src/dsp/upsampling.c \
|
||||
src/dsp/cpu.c \
|
||||
@ -22,7 +20,6 @@ LOCAL_SRC_FILES := \
|
||||
src/dsp/enc.c \
|
||||
src/enc/alpha.c \
|
||||
src/enc/analysis.c \
|
||||
src/enc/bit_writer.c \
|
||||
src/enc/config.c \
|
||||
src/enc/dsp.c \
|
||||
src/enc/filter.c \
|
||||
@ -34,6 +31,9 @@ LOCAL_SRC_FILES := \
|
||||
src/enc/syntax.c \
|
||||
src/enc/tree.c \
|
||||
src/enc/webpenc.c
|
||||
src/utils/bit_reader.c \
|
||||
src/utils/bit_writer.c \
|
||||
src/utils/thread.c \
|
||||
|
||||
LOCAL_CFLAGS := -Wall -DANDROID -DHAVE_MALLOC_H -DHAVE_PTHREAD -DWEBP_USE_THREAD \
|
||||
-finline-functions -frename-registers -ffast-math \
|
||||
|
13
Makefile.vc
13
Makefile.vc
@ -132,7 +132,6 @@ CFGSET = TRUE
|
||||
#
|
||||
|
||||
X_OBJS= \
|
||||
$(DIROBJ)\dec\bits.obj \
|
||||
$(DIROBJ)\dec\frame.obj \
|
||||
$(DIROBJ)\dec\quant.obj \
|
||||
$(DIROBJ)\dec\tree.obj \
|
||||
@ -143,9 +142,7 @@ X_OBJS= \
|
||||
$(DIROBJ)\dec\idec.obj \
|
||||
$(DIROBJ)\dec\alpha.obj \
|
||||
$(DIROBJ)\dec\layer.obj \
|
||||
$(DIROBJ)\dec\thread.obj \
|
||||
$(DIROBJ)\enc\analysis.obj \
|
||||
$(DIROBJ)\enc\bit_writer.obj \
|
||||
$(DIROBJ)\enc\config.obj \
|
||||
$(DIROBJ)\enc\cost.obj \
|
||||
$(DIROBJ)\enc\frame.obj \
|
||||
@ -166,6 +163,9 @@ X_OBJS= \
|
||||
$(DIROBJ)\dsp\dec_sse2.obj \
|
||||
$(DIROBJ)\dsp\cpu.obj \
|
||||
$(DIROBJ)\dsp\yuv.obj \
|
||||
$(DIROBJ)\utils\bit_reader.obj \
|
||||
$(DIROBJ)\utils\bit_writer.obj \
|
||||
$(DIROBJ)\utils\thread.obj \
|
||||
$(RESOURCE)
|
||||
|
||||
EXAMPLES_OBJS = \
|
||||
@ -187,7 +187,7 @@ $(DIRLIB)\$(TARGET): $(X_OBJS)
|
||||
$(LNK) $(LFLAGS) $(X_OBJS)
|
||||
-xcopy $(DIROBJ)\*.pdb $(DIRLIB) /y
|
||||
|
||||
$(X_OBJS): $(DIROBJ)\enc $(DIROBJ)\dec $(DIROBJ)\dsp $(DIRLIB) $(DIRINC) $(DIRBIN)
|
||||
$(X_OBJS): $(DIROBJ)\enc $(DIROBJ)\dec $(DIROBJ)\dsp $(DIROBJ)\utils $(DIRLIB) $(DIRINC) $(DIRBIN)
|
||||
!IF "$(DLLBUILD)" == "TRUE"
|
||||
$(X_OBJS): $(DIROBJ)\$(DLLINC)
|
||||
clean::
|
||||
@ -208,6 +208,9 @@ $(DIROBJ)\dec:
|
||||
$(DIROBJ)\dsp:
|
||||
@if not exist "$(DIROBJ)\dsp" mkdir $(DIROBJ)\dsp
|
||||
|
||||
$(DIROBJ)\utils:
|
||||
@if not exist "$(DIROBJ)\utils" mkdir $(DIROBJ)\utils
|
||||
|
||||
$(DIRLIB):
|
||||
@if not exist "$(DIRLIB)" mkdir $(DIRLIB)
|
||||
|
||||
@ -233,6 +236,8 @@ $(DIROBJ)\$(DLLINC):
|
||||
$(CC) $(CFLAGS) /Fo"$@" $<
|
||||
{src\dsp}.c{$(DIROBJ)\dsp}.obj:
|
||||
$(CC) $(CFLAGS) /Fo"$@" $<
|
||||
{src\utils}.c{$(DIROBJ)\utils}.obj:
|
||||
$(CC) $(CFLAGS) /Fo"$@" $<
|
||||
|
||||
{$(DIROBJ)\examples}.obj{$(DIRBIN)}.exe:
|
||||
$(LNKEXE) $(LDFLAGS) /OUT:"$@" $< ole32.lib windowscodecs.lib shlwapi.lib $(DIRLIB)\$(TARGET)
|
||||
|
@ -153,6 +153,7 @@ AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_FILES([Makefile src/Makefile man/Makefile \
|
||||
examples/Makefile src/dec/Makefile \
|
||||
src/enc/Makefile src/dsp/Makefile \
|
||||
src/utils/Makefile \
|
||||
src/libwebp.pc])
|
||||
|
||||
|
||||
|
@ -56,23 +56,27 @@ CFLAGS = -O3 -DNDEBUG $(EXTRA_FLAGS)
|
||||
INSTALL = install
|
||||
LDFLAGS = $(EXTRA_LIBS) -lm
|
||||
|
||||
OBJS = src/enc/webpenc.o src/enc/bit_writer.o src/enc/syntax.o \
|
||||
src/enc/alpha.o src/enc/layer.o \
|
||||
src/enc/tree.o src/enc/config.o src/enc/frame.o \
|
||||
src/enc/quant.o src/enc/iterator.o src/enc/analysis.o \
|
||||
src/enc/cost.o src/enc/picture.o src/enc/filter.o \
|
||||
src/dec/bits.o src/dec/frame.o \
|
||||
src/dec/webp.o src/dec/quant.o src/dec/tree.o src/dec/vp8.o \
|
||||
src/dec/idec.o src/dec/alpha.o src/dec/layer.o \
|
||||
src/dec/io.o src/dec/buffer.o src/dec/thread.o \
|
||||
src/dsp/cpu.o src/dsp/enc.o src/dsp/enc_sse2.o \
|
||||
src/dsp/dec.o src/dsp/dec_sse2.o \
|
||||
src/dsp/upsampling.o src/dsp/upsampling_sse2.o \
|
||||
src/dsp/yuv.o
|
||||
DEC_OBJS = src/dec/frame.o src/dec/webp.o src/dec/quant.o src/dec/tree.o \
|
||||
src/dec/vp8.o src/dec/idec.o src/dec/alpha.o src/dec/layer.o \
|
||||
src/dec/io.o src/dec/buffer.o
|
||||
ENC_OBJS = src/enc/webpenc.o src/enc/syntax.o \
|
||||
src/enc/alpha.o src/enc/layer.o \
|
||||
src/enc/tree.o src/enc/config.o src/enc/frame.o \
|
||||
src/enc/quant.o src/enc/iterator.o src/enc/analysis.o \
|
||||
src/enc/cost.o src/enc/picture.o src/enc/filter.o
|
||||
DSP_OBJS = src/dsp/cpu.o src/dsp/enc.o \
|
||||
src/dsp/enc_sse2.o src/dsp/dec.o src/dsp/dec_sse2.o \
|
||||
src/dsp/upsampling.o src/dsp/upsampling_sse2.o \
|
||||
src/dsp/yuv.o
|
||||
UTILS_OBJS = src/utils/bit_reader.o src/utils/bit_writer.o src/utils/thread.o
|
||||
|
||||
OBJS = $(DEC_OBJS) $(ENC_OBJS) $(DSP_OBJS) $(UTILS_OBJS)
|
||||
|
||||
HDRS = src/webp/encode.h src/enc/vp8enci.h src/enc/cost.h \
|
||||
src/dec/vp8i.h \
|
||||
src/dsp/yuv.h src/dsp/dsp.h \
|
||||
src/utils/bit_writer.h src/utils/bit_reader.h src/utils/thread.h
|
||||
|
||||
HDRS = src/webp/encode.h src/enc/vp8enci.h src/enc/bit_writer.h \
|
||||
src/enc/cost.h src/dec/bits.h src/dec/vp8i.h src/dsp/yuv.h \
|
||||
src/dsp/dsp.h
|
||||
OUTPUT = examples/cwebp examples/dwebp src/libwebp.a
|
||||
|
||||
all:ex
|
||||
@ -111,6 +115,7 @@ clean:
|
||||
src/enc/*.o src/enc/*~ \
|
||||
src/dec/*.o src/dec/*~ \
|
||||
src/dsp/*.o src/dsp/*~ \
|
||||
src/utils/*.o src/utils/*~ \
|
||||
examples/*.o examples/*~
|
||||
|
||||
superclean: clean
|
||||
|
@ -1,4 +1,4 @@
|
||||
SUBDIRS = dec enc dsp
|
||||
SUBDIRS = dec enc dsp utils
|
||||
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/src
|
||||
lib_LTLIBRARIES = libwebp.la
|
||||
@ -6,6 +6,7 @@ lib_LTLIBRARIES = libwebp.la
|
||||
libwebp_la_SOURCES =
|
||||
libwebp_la_LIBADD = dec/libwebpdecode.la \
|
||||
enc/libwebpencode.la \
|
||||
utils/libwebputils.la \
|
||||
dsp/libwebpdsp.la
|
||||
libwebp_la_LDFLAGS = -version-info 0:0:0
|
||||
libwebpinclude_HEADERS = webp/types.h webp/decode.h webp/decode_vp8.h \
|
||||
|
@ -1,16 +1,13 @@
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/src
|
||||
|
||||
libwebpdecode_la_SOURCES = bits.h vp8i.h bits.c frame.c \
|
||||
quant.c tree.c vp8.c webp.c idec.c alpha.c \
|
||||
layer.c io.c buffer.c thread.c
|
||||
libwebpdecode_la_SOURCES = vp8i.h webpi.h \
|
||||
frame.c quant.c tree.c vp8.c webp.c \
|
||||
idec.c alpha.c layer.c io.c buffer.c
|
||||
libwebpdecode_la_LDFLAGS = -version-info 0:0:0
|
||||
libwebpdecode_la_CPPFLAGS = $(USE_EXPERIMENTAL_CODE)
|
||||
libwebpdecodeinclude_HEADERS = ../webp/decode.h ../webp/decode_vp8.h ../webp/types.h
|
||||
libwebpdecodeincludedir = $(includedir)/webp
|
||||
|
||||
noinst_HEADERS = bits.h vp8i.h webpi.h thread.h
|
||||
noinst_HEADERS = vp8i.h webpi.h
|
||||
|
||||
noinst_LTLIBRARIES = libwebpdecode.la
|
||||
# uncomment the following line (and comment the above) if you want
|
||||
# to install libwebpdecode library.
|
||||
#lib_LTLIBRARIES = libwebpdecode.la
|
||||
|
@ -13,8 +13,8 @@
|
||||
#define WEBP_DEC_VP8I_H_
|
||||
|
||||
#include <string.h> // for memcpy()
|
||||
#include "./bits.h"
|
||||
#include "./thread.h"
|
||||
#include "../utils/bit_reader.h"
|
||||
#include "../utils/thread.h"
|
||||
#include "../dsp/dsp.h"
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
@ -366,4 +366,4 @@ int VP8DecodeLayer(VP8Decoder* const dec);
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // WEBP_DEC_VP8I_H_
|
||||
#endif /* WEBP_DEC_VP8I_H_ */
|
||||
|
@ -1,7 +1,6 @@
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/src
|
||||
|
||||
libwebpencode_la_SOURCES = analysis.c bit_writer.c bit_writer.h \
|
||||
config.c cost.c cost.h filter.c \
|
||||
libwebpencode_la_SOURCES = analysis.c config.c cost.c cost.h filter.c \
|
||||
frame.c iterator.c picture.c quant.c \
|
||||
syntax.c tree.c vp8enci.h webpenc.c alpha.c \
|
||||
layer.c
|
||||
@ -10,5 +9,5 @@ libwebpencode_la_CPPFLAGS = $(USE_EXPERIMENTAL_CODE)
|
||||
libwebpencodeinclude_HEADERS = ../webp/encode.h ../webp/types.h
|
||||
libwebpencodeincludedir = $(includedir)/webp
|
||||
|
||||
noinst_HEADERS = cost.h bit_writer.h vp8enci.h
|
||||
noinst_HEADERS = cost.h vp8enci.h
|
||||
noinst_LTLIBRARIES = libwebpencode.la
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "string.h" // for memcpy()
|
||||
#include "../webp/encode.h"
|
||||
#include "../dsp/dsp.h"
|
||||
#include "bit_writer.h"
|
||||
#include "../utils/bit_writer.h"
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
extern "C" {
|
||||
@ -457,4 +457,4 @@ extern void VP8AdjustFilterStrength(VP8EncIterator* const it);
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // WEBP_ENC_VP8ENCI_H_
|
||||
#endif /* WEBP_ENC_VP8ENCI_H_ */
|
||||
|
13
src/utils/Makefile.am
Normal file
13
src/utils/Makefile.am
Normal file
@ -0,0 +1,13 @@
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/src
|
||||
|
||||
libwebputils_la_SOURCES = bit_reader.h bit_reader.c \
|
||||
bit_writer.h bit_writer.c \
|
||||
thread.h thread.c
|
||||
libwebputils_la_LDFLAGS = -version-info 0:0:0
|
||||
libwebputils_la_CPPFLAGS = $(USE_EXPERIMENTAL_CODE)
|
||||
libwebputilsinclude_HEADERS = ../webp/types.h
|
||||
libwebputilsincludedir = $(includedir)/webp
|
||||
|
||||
noinst_HEADERS = bit_reader.h bit_writer.h thread.h
|
||||
|
||||
noinst_LTLIBRARIES = libwebputils.la
|
@ -9,7 +9,7 @@
|
||||
//
|
||||
// Author: Skal (pascal.massimino@gmail.com)
|
||||
|
||||
#include "bits.h"
|
||||
#include "./bit_reader.h"
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
extern "C" {
|
@ -9,8 +9,8 @@
|
||||
//
|
||||
// Author: Skal (pascal.massimino@gmail.com)
|
||||
|
||||
#ifndef WEBP_DEC_BITS_H_
|
||||
#define WEBP_DEC_BITS_H_
|
||||
#ifndef WEBP_UTILS_BIT_READER_H_
|
||||
#define WEBP_UTILS_BIT_READER_H_
|
||||
|
||||
#include <assert.h>
|
||||
#include "../webp/decode_vp8.h"
|
||||
@ -105,4 +105,4 @@ static inline int VP8GetSigned(VP8BitReader* const br, int v) {
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // WEBP_DEC_BITS_H_
|
||||
#endif /* WEBP_UTILS_BIT_READER_H_ */
|
@ -10,8 +10,9 @@
|
||||
// Author: Skal (pascal.massimino@gmail.com)
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h> // for memcpy()
|
||||
#include <stdlib.h>
|
||||
#include "vp8enci.h"
|
||||
#include "./bit_writer.h"
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
extern "C" {
|
@ -9,8 +9,8 @@
|
||||
//
|
||||
// Author: Skal (pascal.massimino@gmail.com)
|
||||
|
||||
#ifndef WEBP_ENC_BIT_WRITER_H_
|
||||
#define WEBP_ENC_BIT_WRITER_H_
|
||||
#ifndef WEBP_UTILS_BIT_WRITER_H_
|
||||
#define WEBP_UTILS_BIT_WRITER_H_
|
||||
|
||||
#include "../webp/types.h"
|
||||
|
||||
@ -60,4 +60,4 @@ static inline size_t VP8BitWriterSize(const VP8BitWriter* const bw) {
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // WEBP_ENC_BIT_WRITER_H_
|
||||
#endif /* WEBP_UTILS_BIT_WRITER_H_ */
|
@ -9,7 +9,8 @@
|
||||
//
|
||||
// Author: skal@google.com (Pascal Massimino)
|
||||
|
||||
#include "./vp8i.h"
|
||||
#include <assert.h>
|
||||
#include <string.h> // for memset()
|
||||
#include "./thread.h"
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
@ -9,8 +9,8 @@
|
||||
//
|
||||
// Author: skal@google.com (Pascal Massimino)
|
||||
|
||||
#ifndef WEBP_DEC_THREAD_H
|
||||
#define WEBP_DEC_THREAD_H
|
||||
#ifndef WEBP_UTILS_THREAD_H_
|
||||
#define WEBP_UTILS_THREAD_H_
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
extern "C" {
|
||||
@ -33,8 +33,8 @@ typedef struct {
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#endif // _WIN32
|
||||
#endif // WEBP_USE_THREAD
|
||||
#endif /* _WIN32 */
|
||||
#endif /* WEBP_USE_THREAD */
|
||||
|
||||
// State of the worker thread object
|
||||
typedef enum {
|
||||
@ -83,4 +83,4 @@ void WebPWorkerEnd(WebPWorker* const worker);
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // WEBP_DEC_THREAD_H
|
||||
#endif /* WEBP_UTILS_THREAD_H_ */
|
Loading…
Reference in New Issue
Block a user