[FEATURE] FreeType-based text renderer (-out=spupng with teletext/EIA608) (#877)

* Implementation of text renderer

* Fix some characters being cut

* Fix encoding and other bugs

* Add black background & fix bugs

* Fix more bugs

* Change to relative path

* Add a font option & Default font for MacOS & Fix anti-aliasing

* Document -font & enlarge default canvas
This commit is contained in:
Null
2018-01-10 02:24:26 +08:00
committed by Carlos Fernandez Sanz
parent 8f0294b763
commit 930ca716ca
23 changed files with 1381 additions and 1063 deletions

View File

@@ -156,7 +156,6 @@ ccextractor_SOURCES = \
../src/lib_ccx/ccx_encoders_smptett.c \
../src/lib_ccx/ccx_encoders_splitbysentence.c \
../src/lib_ccx/ccx_encoders_spupng.c \
../src/lib_ccx/ccx_encoders_spupng.h \
../src/lib_ccx/ccx_encoders_srt.c \
../src/lib_ccx/ccx_encoders_ssa.c \
../src/lib_ccx/ccx_encoders_structs.h \
@@ -208,8 +207,6 @@ ccextractor_SOURCES = \
../src/lib_ccx/params.c \
../src/lib_ccx/params_dump.c \
../src/lib_ccx/sequencing.c \
../src/lib_ccx/spupng_encoder.c \
../src/lib_ccx/spupng_encoder.h \
../src/lib_ccx/stdintmsc.h \
../src/lib_ccx/stream_functions.c \
../src/lib_ccx/teletext.h \
@@ -268,12 +265,52 @@ ccextractor_SOURCES = \
../src/extractors/extractor.c \
../src/extractors/extractor.h \
../src/wrappers/wrapper.c \
../src/wrappers/wrapper.h
../src/wrappers/wrapper.h \
../src/freetype/autofit/autofit.c \
../src/freetype/base/ftbase.c \
../src/freetype/base/ftbbox.c \
../src/freetype/base/ftbdf.c \
../src/freetype/base/ftbitmap.c \
../src/freetype/base/ftcid.c \
../src/freetype/base/ftfntfmt.c \
../src/freetype/base/ftfstype.c \
../src/freetype/base/ftgasp.c \
../src/freetype/base/ftglyph.c \
../src/freetype/base/ftgxval.c \
../src/freetype/base/ftinit.c \
../src/freetype/base/ftlcdfil.c \
../src/freetype/base/ftmm.c \
../src/freetype/base/ftotval.c \
../src/freetype/base/ftpatent.c \
../src/freetype/base/ftpfr.c \
../src/freetype/base/ftstroke.c \
../src/freetype/base/ftsynth.c \
../src/freetype/base/ftsystem.c \
../src/freetype/base/fttype1.c \
../src/freetype/base/ftwinfnt.c \
../src/freetype/bdf/bdf.c \
../src/freetype/bzip2/ftbzip2.c \
../src/freetype/cache/ftcache.c \
../src/freetype/cff/cff.c \
../src/freetype/cid/type1cid.c \
../src/freetype/gzip/ftgzip.c \
../src/freetype/lzw/ftlzw.c \
../src/freetype/pcf/pcf.c \
../src/freetype/pfr/pfr.c \
../src/freetype/psaux/psaux.c \
../src/freetype/pshinter/pshinter.c \
../src/freetype/psnames/psnames.c \
../src/freetype/raster/raster.c \
../src/freetype/sfnt/sfnt.c \
../src/freetype/smooth/smooth.c \
../src/freetype/truetype/truetype.c \
../src/freetype/type1/type1.c \
../src/freetype/type42/type42.c \
../src/freetype/winfonts/winfnt.c
ccextractor_CFLAGS = -std=gnu99 -Wno-write-strings -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT
ccextractor_CFLAGS = -std=gnu99 -Wno-write-strings -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DFT2_BUILD_LIBRARY
ccextractor_CPPFLAGS =-I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi/ -I../src/lib_hash/ -I../src/protobuf-c/ -I../src/utf8proc/ -I../src/
ccextractor_CPPFLAGS =-I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi/ -I../src/lib_hash/ -I../src/protobuf-c/ -I../src/utf8proc/ -I../src/ -I../src/freetype/include/
ccextractor_LDADD=-lm

View File

@@ -1,6 +1,6 @@
#!/bin/bash
BLD_FLAGS="-std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR"
BLD_INCLUDE="-I../src -I /usr/include/leptonica/ -I /usr/include/tesseract/ -I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi -I../src/lib_hash -I../src/protobuf-c -I../src/utf8proc"
BLD_FLAGS="-std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR -DFT2_BUILD_LIBRARY"
BLD_INCLUDE="-I../src -I /usr/include/leptonica/ -I /usr/include/tesseract/ -I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi -I../src/lib_hash -I../src/protobuf-c -I../src/utf8proc -I../src/freetype/include"
SRC_LIBPNG="$(find ../src/libpng/ -name '*.c')"
SRC_ZLIB="$(find ../src/zlib/ -name '*.c')"
SRC_ZVBI="$(find ../src/zvbi/ -name '*.c')"
@@ -9,9 +9,50 @@ SRC_GPAC="$(find ../src/gpacmp4/ -name '*.c')"
SRC_HASH="$(find ../src/lib_hash/ -name '*.c')"
SRC_PROTOBUF="$(find ../src/protobuf-c/ -name '*.c')"
SRC_UTF8PROC="../src/utf8proc/utf8proc.c"
SRC_FREETYPE="../src/freetype/autofit/autofit.c
../src/freetype/base/ftbase.c
../src/freetype/base/ftbbox.c
../src/freetype/base/ftbdf.c
../src/freetype/base/ftbitmap.c
../src/freetype/base/ftcid.c
../src/freetype/base/ftfntfmt.c
../src/freetype/base/ftfstype.c
../src/freetype/base/ftgasp.c
../src/freetype/base/ftglyph.c
../src/freetype/base/ftgxval.c
../src/freetype/base/ftinit.c
../src/freetype/base/ftlcdfil.c
../src/freetype/base/ftmm.c
../src/freetype/base/ftotval.c
../src/freetype/base/ftpatent.c
../src/freetype/base/ftpfr.c
../src/freetype/base/ftstroke.c
../src/freetype/base/ftsynth.c
../src/freetype/base/ftsystem.c
../src/freetype/base/fttype1.c
../src/freetype/base/ftwinfnt.c
../src/freetype/bdf/bdf.c
../src/freetype/bzip2/ftbzip2.c
../src/freetype/cache/ftcache.c
../src/freetype/cff/cff.c
../src/freetype/cid/type1cid.c
../src/freetype/gzip/ftgzip.c
../src/freetype/lzw/ftlzw.c
../src/freetype/pcf/pcf.c
../src/freetype/pfr/pfr.c
../src/freetype/psaux/psaux.c
../src/freetype/pshinter/pshinter.c
../src/freetype/psnames/psnames.c
../src/freetype/raster/raster.c
../src/freetype/sfnt/sfnt.c
../src/freetype/smooth/smooth.c
../src/freetype/truetype/truetype.c
../src/freetype/type1/type1.c
../src/freetype/type42/type42.c
../src/freetype/winfonts/winfnt.c"
API_WRAPPERS="$(find ../src/wrappers/ -name '*.c')"
API_EXTRACTORS="$(find ../src/extractors/ -name '*.c')"
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_PROTOBUF $SRC_UTF8PROC $API_WRAPPERS $API_EXTRACTORS"
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_PROTOBUF $SRC_UTF8PROC $API_WRAPPERS $API_EXTRACTORS $SRC_FREETYPE"
BLD_LINKER="-lm -zmuldefs -l tesseract -l lept"
./pre-build.sh

View File

@@ -1,6 +1,6 @@
#!/bin/bash
BLD_FLAGS="-g -std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR -DENABLE_HARDSUBX"
BLD_INCLUDE="-I../src -I /usr/local/include -I /usr/include/leptonica/ -I /usr/include/tesseract/ -I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi -I../src/lib_hash -I../src/protobuf-c"
BLD_FLAGS="-g -std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR -DENABLE_HARDSUBX -DFT2_BUILD_LIBRARY"
BLD_INCLUDE="-I../src -I /usr/local/include -I /usr/include/leptonica/ -I /usr/include/tesseract/ -I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi -I../src/lib_hash -I../src/protobuf-c -I../src/freetype/include"
SRC_LIBPNG="$(find ../src/libpng/ -name '*.c')"
SRC_ZLIB="$(find ../src/zlib/ -name '*.c')"
SRC_ZVBI="$(find ../src/zvbi/ -name '*.c')"
@@ -8,11 +8,52 @@ SRC_CCX="$(find ../src/lib_ccx/ -name '*.c')"
SRC_GPAC="$(find ../src/gpacmp4/ -name '*.c')"
SRC_HASH="$(find ../src/lib_hash/ -name '*.c')"
SRC_UTF8="../src/utf8proc/utf8proc.c"
SRC_FREETYPE="../src/freetype/autofit/autofit.c
../src/freetype/base/ftbase.c
../src/freetype/base/ftbbox.c
../src/freetype/base/ftbdf.c
../src/freetype/base/ftbitmap.c
../src/freetype/base/ftcid.c
../src/freetype/base/ftfntfmt.c
../src/freetype/base/ftfstype.c
../src/freetype/base/ftgasp.c
../src/freetype/base/ftglyph.c
../src/freetype/base/ftgxval.c
../src/freetype/base/ftinit.c
../src/freetype/base/ftlcdfil.c
../src/freetype/base/ftmm.c
../src/freetype/base/ftotval.c
../src/freetype/base/ftpatent.c
../src/freetype/base/ftpfr.c
../src/freetype/base/ftstroke.c
../src/freetype/base/ftsynth.c
../src/freetype/base/ftsystem.c
../src/freetype/base/fttype1.c
../src/freetype/base/ftwinfnt.c
../src/freetype/bdf/bdf.c
../src/freetype/bzip2/ftbzip2.c
../src/freetype/cache/ftcache.c
../src/freetype/cff/cff.c
../src/freetype/cid/type1cid.c
../src/freetype/gzip/ftgzip.c
../src/freetype/lzw/ftlzw.c
../src/freetype/pcf/pcf.c
../src/freetype/pfr/pfr.c
../src/freetype/psaux/psaux.c
../src/freetype/pshinter/pshinter.c
../src/freetype/psnames/psnames.c
../src/freetype/raster/raster.c
../src/freetype/sfnt/sfnt.c
../src/freetype/smooth/smooth.c
../src/freetype/truetype/truetype.c
../src/freetype/type1/type1.c
../src/freetype/type42/type42.c
../src/freetype/winfonts/winfnt.c"
API_WRAPPERS="$(find ../src/wrappers/ -name '*.c')"
API_EXTRACTORS="$(find ../src/extractors/ -name '*.c')"
SRC_PROTOBUF="$(find ../src/protobuf-c/ -name '*.c')"
protobuf-c
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_UTF8 $SRC_PROTOBUF $API_WRAPPERS $API_EXTRACTORS"
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_UTF8 $SRC_PROTOBUF $API_WRAPPERS $API_EXTRACTORS $SRC_FREETYPE"
BLD_LINKER="-lm -zmuldefs -l tesseract -l lept -L/usr/local/lib -lswscale -lavutil -pthread -lavformat -lavcodec -lxcb-shm -lxcb -lX11 -llzma -lz -lswresample"
./pre-build.sh

View File

@@ -1,6 +1,6 @@
#!/bin/bash
BLD_FLAGS="-g -std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR"
BLD_INCLUDE="-I../src -I /usr/include/leptonica/ -I /usr/include/tesseract/ -I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi -I../src/lib_hash -I../src/protobuf-c -I../src/utf8proc"
BLD_FLAGS="-g -std=gnu99 -Wno-write-strings -DGPAC_CONFIG_LINUX -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR -DFT2_BUILD_LIBRARY"
BLD_INCLUDE="-I../src -I /usr/include/leptonica/ -I /usr/include/tesseract/ -I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi -I../src/lib_hash -I../src/protobuf-c -I../src/utf8proc -I../src/freetype/include"
SRC_LIBPNG="$(find ../src/libpng/ -name '*.c')"
SRC_ZLIB="$(find ../src/zlib/ -name '*.c')"
SRC_ZVBI="$(find ../src/zvbi/ -name '*.c')"
@@ -9,9 +9,50 @@ SRC_GPAC="$(find ../src/gpacmp4/ -name '*.c')"
SRC_HASH="$(find ../src/lib_hash/ -name '*.c')"
SRC_PROTOBUF="$(find ../src/protobuf-c/ -name '*.c')"
SRC_UTF8PROC="../src/utf8proc/utf8proc.c"
SRC_FREETYPE="../src/freetype/autofit/autofit.c
../src/freetype/base/ftbase.c
../src/freetype/base/ftbbox.c
../src/freetype/base/ftbdf.c
../src/freetype/base/ftbitmap.c
../src/freetype/base/ftcid.c
../src/freetype/base/ftfntfmt.c
../src/freetype/base/ftfstype.c
../src/freetype/base/ftgasp.c
../src/freetype/base/ftglyph.c
../src/freetype/base/ftgxval.c
../src/freetype/base/ftinit.c
../src/freetype/base/ftlcdfil.c
../src/freetype/base/ftmm.c
../src/freetype/base/ftotval.c
../src/freetype/base/ftpatent.c
../src/freetype/base/ftpfr.c
../src/freetype/base/ftstroke.c
../src/freetype/base/ftsynth.c
../src/freetype/base/ftsystem.c
../src/freetype/base/fttype1.c
../src/freetype/base/ftwinfnt.c
../src/freetype/bdf/bdf.c
../src/freetype/bzip2/ftbzip2.c
../src/freetype/cache/ftcache.c
../src/freetype/cff/cff.c
../src/freetype/cid/type1cid.c
../src/freetype/gzip/ftgzip.c
../src/freetype/lzw/ftlzw.c
../src/freetype/pcf/pcf.c
../src/freetype/pfr/pfr.c
../src/freetype/psaux/psaux.c
../src/freetype/pshinter/pshinter.c
../src/freetype/psnames/psnames.c
../src/freetype/raster/raster.c
../src/freetype/sfnt/sfnt.c
../src/freetype/smooth/smooth.c
../src/freetype/truetype/truetype.c
../src/freetype/type1/type1.c
../src/freetype/type42/type42.c
../src/freetype/winfonts/winfnt.c"
API_WRAPPERS="$(find ../src/wrappers/ -name '*.c')"
API_EXTRACTORS="$(find ../src/extractors/ -name '*.c')"
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_PROTOBUF $SRC_UTF8PROC $API_WRAPPERS $API_EXTRACTORS"
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_GPAC $SRC_ZLIB $SRC_ZVBI $SRC_LIBPNG $SRC_HASH $SRC_PROTOBUF $SRC_UTF8PROC $API_WRAPPERS $API_EXTRACTORS $SRC_FREETYPE"
BLD_LINKER="-lm -zmuldefs -l tesseract -l lept"
./pre-build.sh

View File

@@ -156,7 +156,6 @@ ccextractor_SOURCES = \
../src/lib_ccx/ccx_encoders_smptett.c \
../src/lib_ccx/ccx_encoders_splitbysentence.c \
../src/lib_ccx/ccx_encoders_spupng.c \
../src/lib_ccx/ccx_encoders_spupng.h \
../src/lib_ccx/ccx_encoders_srt.c \
../src/lib_ccx/ccx_encoders_ssa.c \
../src/lib_ccx/ccx_encoders_structs.h \
@@ -208,8 +207,6 @@ ccextractor_SOURCES = \
../src/lib_ccx/params.c \
../src/lib_ccx/params_dump.c \
../src/lib_ccx/sequencing.c \
../src/lib_ccx/spupng_encoder.c \
../src/lib_ccx/spupng_encoder.h \
../src/lib_ccx/stdintmsc.h \
../src/lib_ccx/stream_functions.c \
../src/lib_ccx/teletext.h \
@@ -268,12 +265,53 @@ ccextractor_SOURCES = \
../src/extractors/extractor.c \
../src/extractors/extractor.h \
../src/wrappers/wrapper.c \
../src/wrappers/wrapper.h
../src/wrappers/wrapper.h \
../src/freetype/autofit/autofit.c \
../src/freetype/base/ftbase.c \
../src/freetype/base/ftbbox.c \
../src/freetype/base/ftbdf.c \
../src/freetype/base/ftbitmap.c \
../src/freetype/base/ftcid.c \
../src/freetype/base/ftfntfmt.c \
../src/freetype/base/ftfstype.c \
../src/freetype/base/ftgasp.c \
../src/freetype/base/ftglyph.c \
../src/freetype/base/ftgxval.c \
../src/freetype/base/ftinit.c \
../src/freetype/base/ftlcdfil.c \
../src/freetype/base/ftmm.c \
../src/freetype/base/ftotval.c \
../src/freetype/base/ftpatent.c \
../src/freetype/base/ftpfr.c \
../src/freetype/base/ftstroke.c \
../src/freetype/base/ftsynth.c \
../src/freetype/base/ftsystem.c \
../src/freetype/base/fttype1.c \
../src/freetype/base/ftwinfnt.c \
../src/freetype/bdf/bdf.c \
../src/freetype/bzip2/ftbzip2.c \
../src/freetype/cache/ftcache.c \
../src/freetype/cff/cff.c \
../src/freetype/cid/type1cid.c \
../src/freetype/gzip/ftgzip.c \
../src/freetype/lzw/ftlzw.c \
../src/freetype/pcf/pcf.c \
../src/freetype/pfr/pfr.c \
../src/freetype/psaux/psaux.c \
../src/freetype/pshinter/pshinter.c \
../src/freetype/psnames/psnames.c \
../src/freetype/raster/raster.c \
../src/freetype/sfnt/sfnt.c \
../src/freetype/smooth/smooth.c \
../src/freetype/truetype/truetype.c \
../src/freetype/type1/type1.c \
../src/freetype/type42/type42.c \
../src/freetype/winfonts/winfnt.c
ccextractor_CFLAGS = -std=gnu99 -Wno-write-strings -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT
ccextractor_CFLAGS = -std=gnu99 -Wno-write-strings -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DFT2_BUILD_LIBRARY
ccextractor_CPPFLAGS =-I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi/ -I../src/lib_hash/ -I../src/protobuf-c/ -I../src/utf8proc/ -I../src/
ccextractor_CPPFLAGS =-I../src/lib_ccx/ -I../src/gpacmp4/ -I../src/libpng/ -I../src/zlib/ -I../src/zvbi/ -I../src/lib_hash/ -I../src/protobuf-c/ -I../src/utf8proc/ -I../src/ -I../src/freetype/include/
ccextractor_LDADD=-lm

View File

@@ -1,8 +1,8 @@
#!/bin/bash
cd `dirname $0`
BLD_FLAGS="-std=gnu99 -Wno-write-strings -DGPAC_CONFIG_DARWIN -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -Dfopen64=fopen -Dopen64=open -Dlseek64=lseek"
BLD_FLAGS="-std=gnu99 -Wno-write-strings -DGPAC_CONFIG_DARWIN -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -Dfopen64=fopen -Dopen64=open -Dlseek64=lseek -DFT2_BUILD_LIBRARY"
[[ $1 = "OCR" ]] && BLD_FLAGS="$BLD_FLAGS -DENABLE_OCR"
BLD_INCLUDE="-I../src/ -I../src/lib_ccx -I../src/gpacmp4 -I../src/lib_hash -I../src/libpng -I../src/utf8proc -I../src/protobuf-c -I../src/zlib -I../src/zvbi"
BLD_INCLUDE="-I../src/ -I../src/lib_ccx -I../src/gpacmp4 -I../src/lib_hash -I../src/libpng -I../src/utf8proc -I../src/protobuf-c -I../src/zlib -I../src/zvbi -I../src/freetype/include"
[[ $1 = "OCR" ]] && BLD_INCLUDE="$BLD_INCLUDE `pkg-config --cflags --silence-errors tesseract`"
SRC_CCX="$(find ../src/lib_ccx -name '*.c')"
SRC_GPAC="$(find ../src/gpacmp4 -name '*.c')"
@@ -14,8 +14,48 @@ SRC_ZLIB="$(find ../src/zlib -name '*.c')"
SRC_ZVBI="$(find ../src/zvbi -name '*.c')"
API_WRAPPERS="$(find ../src/wrappers/ -name '*.c')"
API_EXTRACTORS="$(find ../src/extractors/ -name '*.c')"
BLD_SOURCES="../src/ccextractor.c $SRC_API $SRC_CCX $SRC_GPAC $SRC_LIB_HASH $SRC_LIBPNG $SRC_PROTOBUF $SRC_UTF8 $SRC_ZLIB $SRC_ZVBI $API_WRAPPERS $API_EXTRACTORS"
SRC_FREETYPE="../src/freetype/autofit/autofit.c \
../src/freetype/base/ftbase.c \
../src/freetype/base/ftbbox.c \
../src/freetype/base/ftbdf.c \
../src/freetype/base/ftbitmap.c \
../src/freetype/base/ftcid.c \
../src/freetype/base/ftfntfmt.c \
../src/freetype/base/ftfstype.c \
../src/freetype/base/ftgasp.c \
../src/freetype/base/ftglyph.c \
../src/freetype/base/ftgxval.c \
../src/freetype/base/ftinit.c \
../src/freetype/base/ftlcdfil.c \
../src/freetype/base/ftmm.c \
../src/freetype/base/ftotval.c \
../src/freetype/base/ftpatent.c \
../src/freetype/base/ftpfr.c \
../src/freetype/base/ftstroke.c \
../src/freetype/base/ftsynth.c \
../src/freetype/base/ftsystem.c \
../src/freetype/base/fttype1.c \
../src/freetype/base/ftwinfnt.c \
../src/freetype/bdf/bdf.c \
../src/freetype/bzip2/ftbzip2.c \
../src/freetype/cache/ftcache.c \
../src/freetype/cff/cff.c \
../src/freetype/cid/type1cid.c \
../src/freetype/gzip/ftgzip.c \
../src/freetype/lzw/ftlzw.c \
../src/freetype/pcf/pcf.c \
../src/freetype/pfr/pfr.c \
../src/freetype/psaux/psaux.c \
../src/freetype/pshinter/pshinter.c \
../src/freetype/psnames/psnames.c \
../src/freetype/raster/raster.c \
../src/freetype/sfnt/sfnt.c \
../src/freetype/smooth/smooth.c \
../src/freetype/truetype/truetype.c \
../src/freetype/type1/type1.c \
../src/freetype/type42/type42.c \
../src/freetype/winfonts/winfnt.c"
BLD_SOURCES="../src/ccextractor.c $SRC_API $SRC_CCX $SRC_GPAC $SRC_LIB_HASH $SRC_LIBPNG $SRC_PROTOBUF $SRC_UTF8 $SRC_ZLIB $SRC_ZVBI $SRC_FREETYPE $API_WRAPPERS $API_EXTRACTORS"
BLD_LINKER="-lm -liconv"
[[ $1 = "OCR" ]] && BLD_LINKER="$BLD_LINKER `pkg-config --libs --silence-errors tesseract` `pkg-config --libs --silence-errors lept`"

View File

@@ -39,7 +39,7 @@ configure_file (
"${PROJECT_SOURCE_DIR}/lib_ccx/compile_info_real.h"
)
add_definitions(-DVERSION_FILE_PRESENT)
add_definitions(-DVERSION_FILE_PRESENT -DFT2_BUILD_LIBRARY)
include_directories ("${PROJECT_SOURCE_DIR}")
include_directories ("${PROJECT_SOURCE_DIR}/lib_ccx/")
@@ -52,6 +52,7 @@ include_directories ("${PROJECT_SOURCE_DIR}/extractors/")
include_directories ("${PROJECT_SOURCE_DIR}/wrappers/")
include_directories ("${PROJECT_SOURCE_DIR}/libpng/")
include_directories ("${PROJECT_SOURCE_DIR}/zlib/")
include_directories ("${PROJECT_SOURCE_DIR}/freetype/include/")
aux_source_directory ("${PROJECT_SOURCE_DIR}/protobuf-c/" SOURCEFILE)
aux_source_directory ("${PROJECT_SOURCE_DIR}/zvbi/" SOURCEFILE)
aux_source_directory ("${PROJECT_SOURCE_DIR}/lib_hash/" SOURCEFILE)
@@ -60,6 +61,49 @@ aux_source_directory ("${PROJECT_SOURCE_DIR}/wrappers/" SOURCEFILE)
aux_source_directory ("${PROJECT_SOURCE_DIR}/libpng/" SOURCEFILE)
aux_source_directory ("${PROJECT_SOURCE_DIR}/zlib/" SOURCEFILE)
set(FREETYPE_SOURCE
${PROJECT_SOURCE_DIR}/freetype/autofit/autofit.c
${PROJECT_SOURCE_DIR}/freetype/base/ftbase.c
${PROJECT_SOURCE_DIR}/freetype/base/ftbbox.c
${PROJECT_SOURCE_DIR}/freetype/base/ftbdf.c
${PROJECT_SOURCE_DIR}/freetype/base/ftbitmap.c
${PROJECT_SOURCE_DIR}/freetype/base/ftcid.c
${PROJECT_SOURCE_DIR}/freetype/base/ftfntfmt.c
${PROJECT_SOURCE_DIR}/freetype/base/ftfstype.c
${PROJECT_SOURCE_DIR}/freetype/base/ftgasp.c
${PROJECT_SOURCE_DIR}/freetype/base/ftglyph.c
${PROJECT_SOURCE_DIR}/freetype/base/ftgxval.c
${PROJECT_SOURCE_DIR}/freetype/base/ftinit.c
${PROJECT_SOURCE_DIR}/freetype/base/ftlcdfil.c
${PROJECT_SOURCE_DIR}/freetype/base/ftmm.c
${PROJECT_SOURCE_DIR}/freetype/base/ftotval.c
${PROJECT_SOURCE_DIR}/freetype/base/ftpatent.c
${PROJECT_SOURCE_DIR}/freetype/base/ftpfr.c
${PROJECT_SOURCE_DIR}/freetype/base/ftstroke.c
${PROJECT_SOURCE_DIR}/freetype/base/ftsynth.c
${PROJECT_SOURCE_DIR}/freetype/base/ftsystem.c
${PROJECT_SOURCE_DIR}/freetype/base/fttype1.c
${PROJECT_SOURCE_DIR}/freetype/base/ftwinfnt.c
${PROJECT_SOURCE_DIR}/freetype/bdf/bdf.c
${PROJECT_SOURCE_DIR}/freetype/bzip2/ftbzip2.c
${PROJECT_SOURCE_DIR}/freetype/cache/ftcache.c
${PROJECT_SOURCE_DIR}/freetype/cff/cff.c
${PROJECT_SOURCE_DIR}/freetype/cid/type1cid.c
${PROJECT_SOURCE_DIR}/freetype/gzip/ftgzip.c
${PROJECT_SOURCE_DIR}/freetype/lzw/ftlzw.c
${PROJECT_SOURCE_DIR}/freetype/pcf/pcf.c
${PROJECT_SOURCE_DIR}/freetype/pfr/pfr.c
${PROJECT_SOURCE_DIR}/freetype/psaux/psaux.c
${PROJECT_SOURCE_DIR}/freetype/pshinter/pshinter.c
${PROJECT_SOURCE_DIR}/freetype/psnames/psnames.c
${PROJECT_SOURCE_DIR}/freetype/raster/raster.c
${PROJECT_SOURCE_DIR}/freetype/sfnt/sfnt.c
${PROJECT_SOURCE_DIR}/freetype/smooth/smooth.c
${PROJECT_SOURCE_DIR}/freetype/truetype/truetype.c
${PROJECT_SOURCE_DIR}/freetype/type1/type1.c
${PROJECT_SOURCE_DIR}/freetype/type42/type42.c
${PROJECT_SOURCE_DIR}/freetype/winfonts/winfnt.c
)
#Windows specific libraries and linker flags
if(WIN32)
include_directories ("${PROJECT_SOURCE_DIR}/win_spec_incld/")
@@ -90,7 +134,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set (EXTRA_LIBS ${EXTRA_LIBS} -lz)
set (EXTRA_LIBS ${EXTRA_LIBS} -lz -lm)
find_package (PkgConfig)
@@ -149,7 +193,7 @@ if (PKG_CONFIG_FOUND AND WITH_SHARING)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_SHARING")
endif (PKG_CONFIG_FOUND AND WITH_SHARING)
add_executable (ccextractor ${SOURCEFILE})
add_executable (ccextractor ${SOURCEFILE} ${FREETYPE_SOURCE})
target_link_libraries (ccextractor ${EXTRA_LIBS})
target_include_directories (ccextractor PUBLIC ${EXTRA_INCLUDES})

View File

@@ -569,7 +569,6 @@ void run(PyObject * reporter, char * line, int encoding)
PyObject_CallObject((PyObject*)reporter, args);
}
#endif
int main(int argc, char* argv[])
{
struct ccx_s_options* api_options = api_init_options();

View File

@@ -71,6 +71,9 @@ struct encoder_cfg
int program_number;
unsigned char in_format;
int nospupngocr; // 1 if we don't want to OCR bitmaps to add the text as comments in the XML file in spupng
// text -> png (text render)
char *render_font; // The font used to render text if needed (e.g. teletext->spupng)
//CEA-708
int services_enabled[CCX_DTVCC_MAX_SERVICES];

View File

@@ -1,7 +1,5 @@
#include "ccx_decoders_common.h"
#include "ccx_encoders_common.h"
#include "spupng_encoder.h"
#include "ccx_encoders_spupng.h"
#include "utility.h"
#include "ocr.h"
#include "ccx_decoders_608.h"

View File

@@ -17,6 +17,10 @@
if (ctx->buffer == NULL) { fatal(EXIT_NOT_ENOUGH_MEMORY, "Not enough memory for reallocating buffer, bailing out\n"); } \
}
// CC page dimensions
#define ROWS 15
#define COLUMNS 32
typedef struct ccx_dtvcc_writer_ctx
{
int fd;
@@ -170,6 +174,7 @@ int write_cc_buffer_as_ssa (struct eia608_screen *data, struct encode
int write_cc_buffer_as_webvtt (struct eia608_screen *data, struct encoder_ctx *context);
int write_cc_buffer_as_sami (struct eia608_screen *data, struct encoder_ctx *context);
int write_cc_buffer_as_smptett (struct eia608_screen *data, struct encoder_ctx *context);
int write_cc_buffer_as_spupng (struct eia608_screen *data, struct encoder_ctx *context);
void write_cc_buffer_to_gui (struct eia608_screen *data, struct encoder_ctx *context);
int write_cc_buffer_as_g608 (struct eia608_screen *data, struct encoder_ctx *context);

View File

@@ -1,8 +1,6 @@
#ifdef WITH_LIBCURL
#include "ccx_decoders_common.h"
#include "ccx_encoders_common.h"
#include "spupng_encoder.h"
#include "ccx_encoders_spupng.h"
#include "utility.h"
#include "ocr.h"
#include "ccx_decoders_608.h"

View File

@@ -2,7 +2,6 @@
#include "ccx_common_option.h"
#include "ccx_encoders_common.h"
#include "png.h"
#include "spupng_encoder.h"
#include "ocr.h"
#include "utility.h"
#include "ccx_encoders_helpers.h"

View File

@@ -25,7 +25,6 @@
#include "ccx_common_option.h"
#include "ccx_encoders_common.h"
#include "png.h"
#include "spupng_encoder.h"
#include "ocr.h"
#include "utility.h"
#include "ccx_encoders_helpers.h"

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +0,0 @@
#ifndef __608_SPUPNG_H__
#define __608_SPUPNG_H__
#include "lib_ccx.h"
#include "spupng_encoder.h"
#include "ccx_encoders_common.h"
int write_cc_buffer_as_spupng(struct eia608_screen *data,struct encoder_ctx *context);
#endif /* __608_SPUPNG_H__ */

View File

@@ -1,7 +1,5 @@
#include "ccx_decoders_common.h"
#include "ccx_encoders_common.h"
#include "spupng_encoder.h"
#include "ccx_encoders_spupng.h"
#include "utility.h"
#include "ocr.h"
#include "ccx_decoders_608.h"

View File

@@ -5,7 +5,6 @@
#include "ccx_common_constants.h"
#include "allheaders.h"
#include <dirent.h>
#include "spupng_encoder.h"
#include "ccx_encoders_helpers.h"
#include "ocr.h"
#undef OCR_DEBUG

View File

@@ -13,6 +13,14 @@
#include "hardsubx.h"
#endif
#ifdef _WIN32
#define DEFAULT_FONT_PATH "C:\\Windows\\Fonts\\calibri.ttf"
#elif __APPLE__ // MacOS
#define DEFAULT_FONT_PATH "/System/Library/Fonts/Helvetica.ttc"
#else // Assume linux
#define DEFAULT_FONT_PATH "/usr/share/fonts/truetype/noto/NotoSans-Regular.ttf"
#endif
static int inputfile_capacity=0;
int process_cap_file (char *filename)
@@ -616,8 +624,9 @@ void print_usage (void)
mprint (" ISO-639-2 form (like \"fre\" for french) or a language\n");
mprint (" code followed by a dash and a country code for specialities\n");
mprint (" in languages (like \"fre-ca\" for Canadian French).\n");
mprint (" -nospupngocr When processing DVB don't use the OCR to write the text as");
mprint (" -nospupngocr When processing DVB don't use the OCR to write the text as\n");
mprint (" comments in the XML file.\n");
mprint (" -font: Specify the font that is used when generating png files\n");
mprint ("\n");
mprint ("Options that affect how ccextractor reads and writes (buffering):\n");
@@ -2323,6 +2332,13 @@ int parse_parameters (struct ccx_s_options *opt, int argc, char *argv[])
i++;
continue;
}
if (strcmp(argv[i], "-font") == 0 && i<argc - 1)
{
opt->enc_cfg.render_font = argv[i + 1];
i++;
continue;
}
#ifdef WITH_LIBCURL
if (strcmp (argv[i],"-curlposturl")==0 && i<argc-1)
{
@@ -2495,6 +2511,8 @@ int parse_parameters (struct ccx_s_options *opt, int argc, char *argv[])
opt->enc_cfg.no_type_setting = opt->notypesetting;
opt->enc_cfg.subs_delay = opt->subs_delay;
opt->enc_cfg.gui_mode_reports = opt->gui_mode_reports;
if(opt->enc_cfg.render_font==NULL)
opt->enc_cfg.render_font = DEFAULT_FONT_PATH;
if(opt->output_filename && opt->multiprogram == CCX_FALSE)
opt->enc_cfg.output_filename = strdup(opt->output_filename);
else

View File

@@ -1,599 +0,0 @@
#include "ccfont2.xbm" // CC font from libzvbi
#include "spupng_encoder.h"
#include "ccx_common_common.h"
#include "ccx_encoders_common.h"
#include <assert.h>
#ifdef ENABLE_OCR
#include "ocr.h"
#undef OCR_DEBUG
#endif
#define CCPL (ccfont2_width / CCW * ccfont2_height / CCH)
static int initialized = 0;
void spupng_init_font()
{
uint8_t *t, *p;
int i, j;
/* de-interleave font image (puts all chars in row 0) */
if (!(t = (uint8_t*)malloc(ccfont2_width * ccfont2_height / 8)))
ccx_common_logging.fatal_ftn(EXIT_NOT_ENOUGH_MEMORY, "spupng_init_font: Memory allocation failed");
for (p = t, i = 0; i < CCH; i++)
for (j = 0; j < ccfont2_height; p += ccfont2_width / 8, j += CCH)
memcpy(p, ccfont2_bits + (j + i) * ccfont2_width / 8,
ccfont2_width / 8);
memcpy(ccfont2_bits, t, ccfont2_width * ccfont2_height / 8);
free(t);
}
struct spupng_t *spunpg_init(struct ccx_s_write *out)
{
struct spupng_t *sp = (struct spupng_t *) malloc(sizeof(struct spupng_t));
if (NULL == sp)
ccx_common_logging.fatal_ftn(EXIT_NOT_ENOUGH_MEMORY, "spunpg_init: Memory allocation failed (sp)");
if (!initialized)
{
initialized = 1;
spupng_init_font();
}
if ((sp->fpxml = fdopen(out->fh, "w")) == NULL)
{
ccx_common_logging.fatal_ftn(CCX_COMMON_EXIT_FILE_CREATION_FAILED, "Cannot open %s: %s\n",
out->filename, strerror(errno));
}
sp->dirname = (char *) malloc(
sizeof(char) * (strlen(out->filename) + 3));
if (NULL == sp->dirname)
ccx_common_logging.fatal_ftn(EXIT_NOT_ENOUGH_MEMORY, "spunpg_init: Memory allocation failed (sp->dirname)");
strcpy(sp->dirname, out->filename);
char* p = strrchr(sp->dirname, '.');
if (NULL == p)
p = sp->dirname + strlen(sp->dirname);
*p = '\0';
strcat(sp->dirname, ".d");
if (0 != mkdir(sp->dirname, 0777))
{
if (errno != EEXIST)
{
ccx_common_logging.fatal_ftn(CCX_COMMON_EXIT_FILE_CREATION_FAILED, "Cannot create %s: %s\n",
sp->dirname, strerror(errno));
}
// If dirname isn't a directory or if we don't have write permission,
// the first attempt to create a .png file will fail and we'll XXxit.
}
// enough to append /subNNNN.png
sp->pngfile = (char *) malloc(sizeof(char) * (strlen(sp->dirname) + 13));
if (NULL == sp->pngfile)
ccx_common_logging.fatal_ftn(EXIT_NOT_ENOUGH_MEMORY, "spunpg_init: Memory allocation failed (sp->pngfile)");
sp->fileIndex = 0;
sprintf(sp->pngfile, "%s/sub%04d.png", sp->dirname, sp->fileIndex);
// For NTSC closed captions and 720x480 DVD subtitle resolution:
// Each character is 16x26.
// 15 rows by 32 columns, plus 2 columns for left & right padding
// So each .png image will be 16*34 wide and 26*15 high, or 544x390
// To center image in 720x480 DVD screen, offset image by 88 and 45
// Need to keep yOffset even to prevent flicker on interlaced displays
// Would need to do something different for PAL format and teletext.
sp->xOffset = 88;
sp->yOffset = 46;
return sp;
}
void spunpg_free(struct spupng_t *sp)
{
free(sp->dirname);
free(sp->pngfile);
free(sp);
}
void spupng_write_header(struct spupng_t *sp,int multiple_files,char *first_input_file)
{
fprintf(sp->fpxml, "<subpictures>\n<stream>\n");
if (multiple_files)
fprintf(sp->fpxml, "<!-- %s -->\n", first_input_file);
}
void spupng_write_footer(struct spupng_t *sp)
{
fprintf(sp->fpxml, "</stream>\n</subpictures>\n");
fflush(sp->fpxml);
fclose(sp->fpxml);
}
void write_spumux_header(struct encoder_ctx *ctx, struct ccx_s_write *out)
{
if (0 == out->spupng_data)
out->spupng_data = spunpg_init(out);
spupng_write_header((struct spupng_t*)out->spupng_data, ctx->multiple_files, ctx->first_input_file);
if (ctx->write_format == CCX_OF_RAW) { // WARN: Memory leak with this flag, free by hand. Maybe bug.
spupng_write_footer(out->spupng_data);
spunpg_free(out->spupng_data);
}
}
void write_spumux_footer(struct ccx_s_write *out)
{
if (0 != out->spupng_data)
{
struct spupng_t *sp = (struct spupng_t *) out->spupng_data;
spupng_write_footer(sp);
spunpg_free(sp);
out->spupng_data = 0;
out->fh = -1;
}
}
/**
* @internal
* @param p Plane of @a canvas_type char, short, int.
* @param i Index.
*
* @return
* Pixel @a i in plane @a p.
*/
#define peek(p, i) \
((canvas_type == sizeof(uint8_t)) ? ((uint8_t *)(p))[i] : \
((canvas_type == sizeof(uint16_t)) ? ((uint16_t *)(p))[i] : \
((uint32_t *)(p))[i]))
/**
* @internal
* @param p Plane of @a canvas_type char, short, int.
* @param i Index.
* @param v Value.
*
* Set pixel @a i in plane @a p to value @a v.
*/
#define poke(p, i, v) \
((canvas_type == sizeof(uint8_t)) ? (((uint8_t *)(p))[i] = (v)) : \
((canvas_type == sizeof(uint16_t)) ? (((uint16_t *)(p))[i] = (v)) : \
(((uint32_t *)(p))[i] = (v))))
/**
* @internal
* @param c Unicode.
* @param italic @c TRUE to switch to slanted character set.
*
* Translate Unicode character to glyph number in ccfont2 image.
*
* @return
* Glyph number.
*/
static unsigned int unicode_ccfont2(unsigned int c, int italic)
{
static const unsigned short specials[] = {
0x00E1, 0x00E9,
0x00ED, 0x00F3, 0x00FA, 0x00E7, 0x00F7, 0x00D1, 0x00F1, 0x25A0,
0x00AE, 0x00B0, 0x00BD, 0x00BF, 0x2122, 0x00A2, 0x00A3, 0x266A,
0x00E0, 0x0020, 0x00E8, 0x00E2, 0x00EA, 0x00EE, 0x00F4, 0x00FB };
unsigned int i;
if (c < 0x0020)
c = 15; /* invalid */
else if (c < 0x0080)
/*c = c */;
else
{
for (i = 0; i < sizeof(specials) / sizeof(specials[0]); i++)
{
if (specials[i] == c)
{
c = i + 6;
goto slant;
}
}
c = 15; /* invalid */
}
slant:
if (italic)
c += 4 * 32;
return c;
}
/**
* @internal
* @param canvas_type sizeof(char, short, int).
* @param canvas Pointer to image plane where the character is to be drawn.
* @param rowstride @a canvas <em>byte</em> distance from line to line.
* @param color Color value of @a canvas_type.
* @param cw Character width in pixels.
* @param ch Character height in pixels.
*
* Draw blank character.
static void
draw_blank(int canvas_type, uint8_t *canvas, unsigned int rowstride,
unsigned int color, int cw, int ch)
{
int x, y;
for (y = 0; y < ch; y++) {
for (x = 0; x < cw; x++)
poke(canvas, x, color);
canvas += rowstride;
}
}
*/
/**
* @internal
* @param canvas_type sizeof(char, short, int).
* @param canvas Pointer to image plane where the character is to be drawn.
* @param rowstride @a canvas <em>byte</em> distance from line to line.
* @param pen Pointer to color palette of @a canvas_type (index 0 background
* pixels, index 1 foreground pixels).
* @param font Pointer to font image with width @a cpl x @a cw pixels, height
* @a ch pixels, depth one bit, bit '1' is foreground.
* @param cpl Chars per line (number of characters in @a font image).
* @param cw Character cell width in pixels.
* @param ch Character cell height in pixels.
* @param glyph Glyph number in font image, 0 ... @a cpl - 1.
* @param underline Bit mask of character rows. For each bit
* 1 << (n = 0 ... @a ch - 1) set all of character row n to
* foreground color.
* @param size Size of character, either NORMAL, DOUBLE_WIDTH (draws left
* and right half), DOUBLE_HEIGHT (draws upper half only),
* DOUBLE_SIZE (left and right upper half), DOUBLE_HEIGHT2
* (lower half), DOUBLE_SIZE2 (left and right lower half).
*
* Draw one character (function template - define a static version with
* constant @a canvas_type, @a font, @a cpl, @a cw, @a ch).
*/
static void draw_char(int canvas_type, uint8_t *canvas, int rowstride,
uint8_t *pen, uint8_t *font, int cpl, int cw, int ch,
int glyph, unsigned int underline)
{
uint8_t *src;
int shift, x, y;
assert(cw >= 8 && cw <= 16);
assert(ch >= 1 && ch <= 31);
x = glyph * cw;
shift = x & 7;
src = font + (x >> 3);
for (y = 0; y < ch; underline >>= 1, y++)
{
int bits = ~0;
if (!(underline & 1))
{
#ifdef __i386__
bits = (*((uint16_t *) src) >> shift);
#else
/* unaligned/little endian */
bits = ((src[1] * 256 + src[0]) >> shift);
#endif
}
for (x = 0; x < cw; bits >>= 1, x++)
poke(canvas, x, peek(pen, bits & 1));
canvas += rowstride;
src += cpl * cw / 8;
}
}
/*
* PNG and XPM drawing functions (palette-based)
*/
void draw_char_indexed(uint8_t * canvas, int rowstride, uint8_t * pen,
int unicode, int italic, int underline)
{
draw_char(sizeof(*canvas), canvas, rowstride,
pen, (uint8_t *) ccfont2_bits, CCPL, CCW, CCH,
unicode_ccfont2(unicode, italic),
underline * (3 << 24) /* cell row 24, 25 */);
}
void write_sputag_open (struct spupng_t *sp,LLONG ms_start,LLONG ms_end)
{
fprintf(sp->fpxml, "<spu start=\"%.3f\"", ((double)ms_start) / 1000);
fprintf(sp->fpxml, " end=\"%.3f\"", ((double)ms_end) / 1000);
fprintf(sp->fpxml, " image=\"%s\"", sp->pngfile);
fprintf(sp->fpxml, " xoffset=\"%d\"", sp->xOffset);
fprintf(sp->fpxml, " yoffset=\"%d\"", sp->yOffset);
fprintf(sp->fpxml, ">\n");
}
void write_sputag_close(struct spupng_t *sp)
{
fprintf(sp->fpxml, "</spu>\n");
}
void write_spucomment(struct spupng_t *sp,const char *str)
{
fprintf(sp->fpxml, "<!--\n");
fprintf(sp->fpxml, "%s\n", str);
fprintf(sp->fpxml, "-->\n");
}
char* get_spupng_filename(void *ctx)
{
struct spupng_t *sp = (struct spupng_t *)ctx;
return sp->pngfile;
}
void inc_spupng_fileindex(void *ctx)
{
struct spupng_t *sp = (struct spupng_t *)ctx;
sp->fileIndex++;
sprintf(sp->pngfile, "%s/sub%04d.png", sp->dirname, sp->fileIndex);
}
void set_spupng_offset(void *ctx,int x,int y)
{
struct spupng_t *sp = (struct spupng_t *)ctx;
sp->xOffset = x;
sp->yOffset = y;
}
int save_spupng(const char *filename, uint8_t *bitmap, int w, int h,
png_color *palette, png_byte *alpha, int nb_color)
{
FILE *f = NULL;
png_structp png_ptr = NULL;
png_infop info_ptr = NULL;
png_bytep* row_pointer = NULL;
int i, j, ret = 0;
int k = 0;
if(!h)
h = 1;
if(!w)
w = 1;
f = fopen(filename, "wb");
if (!f)
{
ccx_common_logging.log_ftn("DVB:unable to open %s in write mode \n", filename);
ret = -1;
goto end;
}
png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL,NULL);
if (!png_ptr)
{
ccx_common_logging.log_ftn("DVB:unable to create png write struct\n");
goto end;
}
if (!(info_ptr = png_create_info_struct(png_ptr)))
{
ccx_common_logging.log_ftn("DVB:unable to create png info struct\n");
ret = -1;
goto end;
}
row_pointer = (png_bytep*) malloc(sizeof(png_bytep) * h);
if (!row_pointer)
{
ccx_common_logging.log_ftn("DVB: unable to allocate row_pointer\n");
ret = -1;
goto end;
}
memset(row_pointer, 0, sizeof(png_bytep) * h);
png_init_io(png_ptr, f);
png_set_IHDR(png_ptr, info_ptr, w, h,
/* bit_depth */8,
PNG_COLOR_TYPE_PALETTE,
PNG_INTERLACE_NONE,
PNG_COMPRESSION_TYPE_DEFAULT,
PNG_FILTER_TYPE_DEFAULT);
png_set_PLTE(png_ptr, info_ptr, palette, nb_color);
png_set_tRNS(png_ptr, info_ptr, alpha, nb_color, NULL);
for (i = 0; i < h; i++)
{
row_pointer[i] = (png_byte*) malloc(
png_get_rowbytes(png_ptr, info_ptr));
if (row_pointer[i] == NULL)
break;
}
if (i != h)
{
ccx_common_logging.log_ftn("DVB: unable to allocate row_pointer internals\n");
ret = -1;
goto end;
}
png_write_info(png_ptr, info_ptr);
for (i = 0; i < h; i++)
{
for (j = 0; j < png_get_rowbytes(png_ptr, info_ptr); j++)
{
if(bitmap)
k = bitmap[i * w + (j)];
else
k = 0;
row_pointer[i][j] = k;
}
}
png_write_image(png_ptr, row_pointer);
png_write_end(png_ptr, info_ptr);
end: if (row_pointer)
{
for (i = 0; i < h; i++)
freep(&row_pointer[i]);
freep(&row_pointer);
}
png_destroy_write_struct(&png_ptr, &info_ptr);
if (f)
fclose(f);
return ret;
}
/**
* alpha value 255 means completely opaque
* alpha value 0 means completely transparent
* r g b all 0 means black
* r g b all 255 means white
*/
int mapclut_paletee(png_color *palette, png_byte *alpha, uint32_t *clut,
uint8_t depth)
{
for (int i = 0; i < depth; i++)
{
palette[i].red = ((clut[i] >> 16) & 0xff);
palette[i].green = ((clut[i] >> 8) & 0xff);
palette[i].blue = (clut[i] & 0xff);
alpha[i] = ((clut[i] >> 24) & 0xff);
}
#if OCR_DEBUG
ccx_common_logging.log_ftn("Colors present in original Image\n");
for (int i = 0; i < depth; i++)
{
ccx_common_logging.log_ftn("%02d)r %03d g %03d b %03d a %03d\n",
i, palette[i].red, palette[i].green, palette[i].blue, alpha[i]);
}
#endif
return 0;
}
int write_cc_bitmap_as_spupng(struct cc_subtitle *sub, struct encoder_ctx *context)
{
struct spupng_t *sp = (struct spupng_t *)context->out->spupng_data;
int x_pos, y_pos, width, height, i;
int x, y, y_off, x_off, ret=0;
uint8_t *pbuf;
char *filename;
struct cc_bitmap* rect;
png_color *palette = NULL;
png_byte *alpha = NULL;
int wrote_opentag = 1;
x_pos = -1;
y_pos = -1;
width = 0;
height = 0;
if (sub->data == NULL)
return 0;
write_sputag_open(sp, sub->start_time, sub->end_time - 1);
if(sub->nb_data == 0 && (sub->flags & SUB_EOD_MARKER))
{
context->prev_start = -1;
if (wrote_opentag)
write_sputag_close(sp);
return 0;
}
rect = sub->data;
for(i = 0;i < sub->nb_data;i++)
{
if(x_pos == -1)
{
x_pos = rect[i].x;
y_pos = rect[i].y;
width = rect[i].w;
height = rect[i].h;
}
else
{
if(x_pos > rect[i].x)
{
width += (x_pos - rect[i].x);
x_pos = rect[i].x;
}
if (rect[i].y < y_pos)
{
height += (y_pos - rect[i].y);
y_pos = rect[i].y;
}
if (rect[i].x + rect[i].w > x_pos + width)
{
width = rect[i].x + rect[i].w - x_pos;
}
if (rect[i].y + rect[i].h > y_pos + height)
{
height = rect[i].y + rect[i].h - y_pos;
}
}
}
inc_spupng_fileindex(sp);
filename = get_spupng_filename(sp);
set_spupng_offset(sp, x_pos, y_pos);
if ( sub->flags & SUB_EOD_MARKER )
context->prev_start = sub->start_time;
pbuf = (uint8_t*) malloc(width * height);
memset(pbuf, 0x0, width * height);
for(i = 0;i < sub->nb_data;i++)
{
x_off = rect[i].x - x_pos;
y_off = rect[i].y - y_pos;
for (y = 0; y < rect[i].h; y++)
{
for (x = 0; x < rect[i].w; x++)
pbuf[((y + y_off) * width) + x_off + x] = rect[i].data[0][y * rect[i].w + x];
}
}
palette = (png_color*) malloc(rect[0].nb_colors * sizeof(png_color));
if(!palette)
{
ret = -1;
goto end;
}
alpha = (png_byte*) malloc(rect[0].nb_colors * sizeof(png_byte));
if(!alpha)
{
ret = -1;
goto end;
}
/* TODO do rectangle wise, one color table should not be used for all rectangles */
mapclut_paletee(palette, alpha, (uint32_t *)rect[0].data[1],rect[0].nb_colors);
#ifdef ENABLE_OCR
if (!context->nospupngocr)
{
char *str;
str = paraof_ocrtext(sub, context->encoded_crlf, context->encoded_crlf_length);
if (str)
{
write_spucomment(sp, str);
freep(&str);
}
}
#endif
save_spupng(filename,pbuf,width, height, palette, alpha,rect[0].nb_colors);
freep(&pbuf);
end:
if (wrote_opentag)
write_sputag_close(sp);
for(i = 0, rect = sub->data; i < sub->nb_data; i++, rect++)
{
freep(rect->data);
freep(rect->data+1);
}
sub->nb_data = 0;
freep(&sub->data);
freep(&palette);
freep(&alpha);
freep(&pbuf);
return ret;
}

View File

@@ -1,39 +0,0 @@
#ifndef _SPUPNG_ENCODER_H
#define _SPUPNG_ENCODER_H
#include "ccx_common_platform.h"
#include "ccx_encoders_structs.h"
#include "png.h"
#include "ccx_encoders_common.h"
// CC page dimensions
#define ROWS 15
#define COLUMNS 32
/* Closed Caption character cell dimensions */
#define CCW 16
#define CCH 26 /* line doubled */
struct spupng_t
{
FILE* fpxml;
FILE* fppng;
char* dirname;
char* pngfile;
int fileIndex;
int xOffset;
int yOffset;
};
void write_spumux_header(struct encoder_ctx *ctx, struct ccx_s_write *out);
void write_spumux_footer(struct ccx_s_write *out);
void draw_char_indexed(uint8_t * canvas, int rowstride, uint8_t * pen,
int unicode, int italic, int underline);
void write_sputag_open(struct spupng_t *sp,LLONG ms_start,LLONG ms_end);
void write_sputag_close(struct spupng_t *sp);
void write_spucomment(struct spupng_t *sp,const char *str);
char* get_spupng_filename(void *ctx);
void inc_spupng_fileindex(void *ctx);
void set_spupng_offset(void *ctx,int x,int y);
int mapclut_paletee(png_color *palette, png_byte *alpha, uint32_t *clut,
uint8_t depth);
#endif

View File

@@ -37,6 +37,7 @@
<ItemGroup>
<ClInclude Include="..\src\ccextractor.h" />
<ClInclude Include="..\src\extractors\extractor.h" />
<ClInclude Include="..\src\lib_ccx\ccx_encoders_structs.h" />
<ClInclude Include="..\src\wrappers\wrapper.h" />
<ClInclude Include="..\src\gpacmp4\gpac\avparse.h" />
<ClInclude Include="..\src\gpacmp4\gpac\base_coding.h" />
@@ -75,7 +76,6 @@
<ClInclude Include="..\src\libpng\pnglibconf.h" />
<ClInclude Include="..\src\libpng\pngpriv.h" />
<ClInclude Include="..\src\libpng\pngstruct.h" />
<ClInclude Include="..\src\lib_ccx\608_spupng.h" />
<ClInclude Include="..\src\lib_ccx\avc_functions.h" />
<ClInclude Include="..\src\lib_ccx\ccx_common_char_encoding.h" />
<ClInclude Include="..\src\lib_ccx\ccx_common_common.h" />
@@ -93,11 +93,9 @@
<ClInclude Include="..\src\lib_ccx\ccx_decoders_xds.h" />
<ClInclude Include="..\src\lib_ccx\ccx_encoders_common.h" />
<ClInclude Include="..\src\lib_ccx\ccx_encoders_helpers.h" />
<ClInclude Include="..\src\lib_ccx\ccx_encoders_structs.h" />
<ClInclude Include="..\src\lib_ccx\disable_warnings.h" />
<ClInclude Include="..\src\lib_ccx\dvb_subtitle_decoder.h" />
<ClInclude Include="..\src\lib_ccx\lib_ccx.h" />
<ClInclude Include="..\src\lib_ccx\spupng_encoder.h" />
<ClInclude Include="..\src\lib_ccx\teletext.h" />
<ClInclude Include="..\src\lib_ccx\utility.h" />
<ClInclude Include="..\src\lib_hash\sha2.h" />
@@ -127,10 +125,18 @@
<ClInclude Include="..\src\zvbi\zvbi_decoder.h" />
<ClInclude Include="..\src\win_spec_incld\inttypes.h" />
<ClInclude Include="..\src\win_spec_incld\stdint.h" />
<ClInclude Include="..\src\freetype\include\ft2build.h" />
<ClInclude Include="..\src\freetype\include\freetype\config\ftconfig.h" />
<ClInclude Include="..\src\freetype\include\freetype\config\ftheader.h" />
<ClInclude Include="..\src\freetype\include\freetype\config\ftmodule.h" />
<ClInclude Include="..\src\freetype\include\freetype\config\ftoption.h" />
<ClInclude Include="..\src\freetype\include\freetype\config\ftstdlib.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\extractors\extractor.c" />
<ClCompile Include="..\src\freetype\gzip\ftgzip.c" />
<ClCompile Include="..\src\lib_ccx\ccx_demuxer_mxf.c" />
<ClCompile Include="..\src\lib_ccx\ccx_encoders_spupng.c" />
<ClCompile Include="..\src\wrappers\wrapper.c" />
<ClCompile Include="..\src\ccextractor.c" />
<ClCompile Include="..\src\gpacmp4\avc_ext.c" />
@@ -222,7 +228,6 @@
<ClCompile Include="..\src\lib_ccx\ccx_encoders_sami.c" />
<ClCompile Include="..\src\lib_ccx\ccx_encoders_smptett.c" />
<ClCompile Include="..\src\lib_ccx\ccx_encoders_splitbysentence.c" />
<ClCompile Include="..\src\lib_ccx\ccx_encoders_spupng.c" />
<ClCompile Include="..\src\lib_ccx\ccx_encoders_srt.c" />
<ClCompile Include="..\src\lib_ccx\ccx_encoders_ssa.c" />
<ClCompile Include="..\src\lib_ccx\ccx_encoders_transcript.c" />
@@ -254,7 +259,6 @@
<ClCompile Include="..\src\lib_ccx\params.c" />
<ClCompile Include="..\src\lib_ccx\params_dump.c" />
<ClCompile Include="..\src\lib_ccx\sequencing.c" />
<ClCompile Include="..\src\lib_ccx\spupng_encoder.c" />
<ClCompile Include="..\src\lib_ccx\stream_functions.c" />
<ClCompile Include="..\src\lib_ccx\telxcc.c" />
<ClCompile Include="..\src\lib_ccx\ts_functions.c" />
@@ -279,6 +283,43 @@
<ClCompile Include="..\src\zvbi\decoder.c" />
<ClCompile Include="..\src\zvbi\raw_decoder.c" />
<ClCompile Include="..\src\zvbi\sampling_par.c" />
<ClCompile Include="..\src\freetype\autofit\autofit.c" />
<ClCompile Include="..\src\freetype\bdf\bdf.c" />
<ClCompile Include="..\src\freetype\cff\cff.c" />
<ClCompile Include="..\src\freetype\base\ftbase.c" />
<ClCompile Include="..\src\freetype\base\ftbitmap.c" />
<ClCompile Include="..\src\freetype\cache\ftcache.c" />
<ClCompile Include="..\src\freetype\base\ftfstype.c" />
<ClCompile Include="..\src\freetype\base\ftgasp.c" />
<ClCompile Include="..\src\freetype\base\ftglyph.c" />
<ClCompile Include="..\src\freetype\base\ftinit.c" />
<ClCompile Include="..\src\freetype\lzw\ftlzw.c" />
<ClCompile Include="..\src\freetype\base\ftstroke.c" />
<ClCompile Include="..\src\freetype\base\ftsystem.c" />
<ClCompile Include="..\src\freetype\smooth\smooth.c" />
<ClCompile Include="..\src\freetype\base\ftbbox.c" />
<ClCompile Include="..\src\freetype\base\ftfntfmt.c" />
<ClCompile Include="..\src\freetype\base\ftmm.c" />
<ClCompile Include="..\src\freetype\base\ftpfr.c" />
<ClCompile Include="..\src\freetype\base\ftsynth.c" />
<ClCompile Include="..\src\freetype\base\fttype1.c" />
<ClCompile Include="..\src\freetype\base\ftwinfnt.c" />
<ClCompile Include="..\src\freetype\base\ftlcdfil.c" />
<ClCompile Include="..\src\freetype\base\ftgxval.c" />
<ClCompile Include="..\src\freetype\base\ftotval.c" />
<ClCompile Include="..\src\freetype\base\ftpatent.c" />
<ClCompile Include="..\src\freetype\pcf\pcf.c" />
<ClCompile Include="..\src\freetype\pfr\pfr.c" />
<ClCompile Include="..\src\freetype\psaux\psaux.c" />
<ClCompile Include="..\src\freetype\pshinter\pshinter.c" />
<ClCompile Include="..\src\freetype\psnames\psmodule.c" />
<ClCompile Include="..\src\freetype\raster\raster.c" />
<ClCompile Include="..\src\freetype\sfnt\sfnt.c" />
<ClCompile Include="..\src\freetype\truetype\truetype.c" />
<ClCompile Include="..\src\freetype\type1\type1.c" />
<ClCompile Include="..\src\freetype\cid\type1cid.c" />
<ClCompile Include="..\src\freetype\type42\type42.c" />
<ClCompile Include="..\src\freetype\winfonts\winfnt.c" />
</ItemGroup>
<ItemGroup>
<None Include="..\src\lib_ccx\ccx_sub_entry_message.proto" />
@@ -403,8 +444,8 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\src\win_spec_incld;..\src\lib_ccx;..\src\lib_hash;..\src\zvbi;..\src\protobuf-c;..\src\gpacmp4;..\src\win_iconv;..\src\zlib;..\src\libpng;..\src;libs\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\src\freetype\include;..\src\win_spec_incld;..\src\lib_ccx;..\src\lib_hash;..\src\zvbi;..\src\protobuf-c;..\src\gpacmp4;..\src\win_iconv;..\src\zlib;..\src\libpng;..\src;libs\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;FT2_BUILD_LIBRARY;_DEBUG;_CONSOLE;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
@@ -443,7 +484,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Full|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\src\win_spec_incld;..\src\lib_ccx;..\src\lib_hash;..\src\zvbi;..\src\protobuf-c;..\src\gpacmp4;..\src\win_iconv;..\src\zlib;..\src\libpng;..\src;libs\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\src\freetype\include;..\src\win_spec_incld;..\src\lib_ccx;..\src\lib_hash;..\src\zvbi;..\src\protobuf-c;..\src\gpacmp4;..\src\win_iconv;..\src\zlib;..\src\libpng;..\src;libs\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>SEGMENT_BY_FILE_TIME;ENABLE_HARDSUBX;ENABLE_OCR;WIN32;_DEBUG;_CONSOLE;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@@ -503,7 +544,7 @@ xcopy /y "$(ProjectDir)libs\lib\libtesseract304d.dll" "$(ProjectDir)$(OutDir)"</
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Full|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<AdditionalIncludeDirectories>..\src\win_spec_incld;..\src\lib_ccx;..\src\lib_hash;..\src\zvbi;..\src\protobuf-c;..\src\gpacmp4;..\src\win_iconv;..\src\libpng;..\src\zlib;..\src;libs\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\src\freetype\include;..\src\win_spec_incld;..\src\lib_ccx;..\src\lib_hash;..\src\zvbi;..\src\protobuf-c;..\src\gpacmp4;..\src\win_iconv;..\src\libpng;..\src\zlib;..\src;libs\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>ENABLE_HARDSUBX;VERSION_FILE_PRESENT;ENABLE_OCR;WIN32;NDEBUG;_CONSOLE;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
@@ -562,7 +603,7 @@ xcopy /y "$(ProjectDir)libs\lib\libtesseract304d.dll" "$(ProjectDir)$(OutDir)"</
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>..\src\win_spec_incld;..\src\lib_ccx;..\src\lib_hash;..\src\zvbi;..\src\protobuf-c;..\src\gpacmp4;..\src\win_iconv;..\src\zlib;..\src\libpng;..\src;libs\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\src\freetype\include;..\src\win_spec_incld;..\src\lib_ccx;..\src\lib_hash;..\src\zvbi;..\src\protobuf-c;..\src\gpacmp4;..\src\win_iconv;..\src\zlib;..\src\libpng;..\src;libs\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>VERSION_FILE_PRESENT;WIN32;NDEBUG;_CONSOLE;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader />

View File

@@ -31,9 +31,6 @@
<Filter Include="Header Files\zlib">
<UniqueIdentifier>{e76a99a9-8a06-4ffb-afa1-f87c057f8448}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\ccx_decoders">
<UniqueIdentifier>{5af060a0-c719-4d1b-913f-71c4452fbe10}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\ccx_common">
<UniqueIdentifier>{955fdac2-43c6-4968-8fce-7d40bad9c712}</UniqueIdentifier>
</Filter>
@@ -88,6 +85,15 @@
<Filter Include="Header Files\lib_ccx\ccx_encoders">
<UniqueIdentifier>{489d2c0b-43e8-4d51-8304-f4e59ee8d253}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\freetype">
<UniqueIdentifier>{c08646ce-ae7b-4747-a1e9-9fad759d9ad2}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\freetype">
<UniqueIdentifier>{2c6ca4e0-5f31-46b1-8714-93fb2c28c174}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\lib_ccx\ccx_decoders">
<UniqueIdentifier>{5af060a0-c719-4d1b-913f-71c4452fbe10}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\libpng\png.h">
@@ -166,28 +172,25 @@
<Filter>Header Files\ccx_common</Filter>
</ClInclude>
<ClInclude Include="..\src\lib_ccx\ccx_decoders_608.h">
<Filter>Header Files\ccx_decoders</Filter>
<Filter>Header Files\lib_ccx\ccx_decoders</Filter>
</ClInclude>
<ClInclude Include="..\src\lib_ccx\ccx_decoders_708.h">
<Filter>Header Files\ccx_decoders</Filter>
<Filter>Header Files\lib_ccx\ccx_decoders</Filter>
</ClInclude>
<ClInclude Include="..\src\lib_ccx\ccx_decoders_common.h">
<Filter>Header Files\ccx_decoders</Filter>
<Filter>Header Files\lib_ccx\ccx_decoders</Filter>
</ClInclude>
<ClInclude Include="..\src\lib_ccx\ccx_decoders_structs.h">
<Filter>Header Files\ccx_decoders</Filter>
<Filter>Header Files\lib_ccx\ccx_decoders</Filter>
</ClInclude>
<ClInclude Include="..\src\lib_ccx\ccx_decoders_xds.h">
<Filter>Header Files\ccx_decoders</Filter>
<Filter>Header Files\lib_ccx\ccx_decoders</Filter>
</ClInclude>
<ClInclude Include="..\src\lib_ccx\dvb_subtitle_decoder.h">
<Filter>Header Files\ccx_decoders</Filter>
<Filter>Header Files\lib_ccx\ccx_decoders</Filter>
</ClInclude>
<ClInclude Include="..\src\lib_ccx\teletext.h">
<Filter>Header Files\ccx_decoders</Filter>
</ClInclude>
<ClInclude Include="..\src\lib_ccx\608_spupng.h">
<Filter>Header Files\lib_ccx\ccx_encoders</Filter>
<Filter>Header Files\lib_ccx\ccx_decoders</Filter>
</ClInclude>
<ClInclude Include="..\src\lib_ccx\ccx_encoders_common.h">
<Filter>Header Files\lib_ccx\ccx_encoders</Filter>
@@ -195,20 +198,14 @@
<ClInclude Include="..\src\lib_ccx\ccx_encoders_helpers.h">
<Filter>Header Files\lib_ccx\ccx_encoders</Filter>
</ClInclude>
<ClInclude Include="..\src\lib_ccx\ccx_encoders_structs.h">
<Filter>Header Files\lib_ccx\ccx_encoders</Filter>
</ClInclude>
<ClInclude Include="..\src\lib_ccx\spupng_encoder.h">
<Filter>Header Files\lib_ccx\ccx_encoders</Filter>
</ClInclude>
<ClInclude Include="..\src\lib_ccx\ccx_decoders_708_encoding.h">
<Filter>Header Files\ccx_decoders</Filter>
<Filter>Header Files\lib_ccx\ccx_decoders</Filter>
</ClInclude>
<ClInclude Include="..\src\lib_ccx\ccx_decoders_708_output.h">
<Filter>Header Files\ccx_decoders</Filter>
<Filter>Header Files\lib_ccx\ccx_decoders</Filter>
</ClInclude>
<ClInclude Include="..\src\lib_ccx\ccx_decoders_isdb.h">
<Filter>Header Files\ccx_decoders</Filter>
<Filter>Header Files\lib_ccx\ccx_decoders</Filter>
</ClInclude>
<ClInclude Include="..\src\lib_ccx\avc_functions.h">
<Filter>Header Files</Filter>
@@ -366,6 +363,27 @@
<ClInclude Include="..\src\ccextractor.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\freetype\include\ft2build.h">
<Filter>Header Files\freetype</Filter>
</ClInclude>
<ClInclude Include="..\src\freetype\include\freetype\config\ftstdlib.h">
<Filter>Header Files\freetype</Filter>
</ClInclude>
<ClInclude Include="..\src\freetype\include\freetype\config\ftheader.h">
<Filter>Header Files\freetype</Filter>
</ClInclude>
<ClInclude Include="..\src\freetype\include\freetype\config\ftmodule.h">
<Filter>Header Files\freetype</Filter>
</ClInclude>
<ClInclude Include="..\src\freetype\include\freetype\config\ftoption.h">
<Filter>Header Files\freetype</Filter>
</ClInclude>
<ClInclude Include="..\src\freetype\include\freetype\config\ftconfig.h">
<Filter>Header Files\freetype</Filter>
</ClInclude>
<ClInclude Include="..\src\lib_ccx\ccx_encoders_structs.h">
<Filter>Header Files\lib_ccx\ccx_encoders</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\ccextractor.c">
@@ -476,9 +494,6 @@
<ClCompile Include="..\src\lib_ccx\ccx_encoders_helpers.c">
<Filter>Source Files\ccx_encoders</Filter>
</ClCompile>
<ClCompile Include="..\src\lib_ccx\spupng_encoder.c">
<Filter>Source Files\ccx_encoders</Filter>
</ClCompile>
<ClCompile Include="..\src\lib_ccx\ccx_common_option.c">
<Filter>Source Files\ccx_common</Filter>
</ClCompile>
@@ -506,9 +521,6 @@
<ClCompile Include="..\src\lib_ccx\ccx_encoders_smptett.c">
<Filter>Source Files\ccx_encoders</Filter>
</ClCompile>
<ClCompile Include="..\src\lib_ccx\ccx_encoders_spupng.c">
<Filter>Source Files\ccx_encoders</Filter>
</ClCompile>
<ClCompile Include="..\src\lib_ccx\ccx_encoders_srt.c">
<Filter>Source Files\ccx_encoders</Filter>
</ClCompile>
@@ -827,6 +839,126 @@
<ClCompile Include="..\src\lib_ccx\ccx_encoders_python.c">
<Filter>Source Files\ccx_encoders</Filter>
</ClCompile>
<ClCompile Include="..\src\lib_ccx\ccx_demuxer_mxf.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\autofit\autofit.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\bdf\bdf.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\cff\cff.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\base\ftbase.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\base\ftbbox.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\base\ftbitmap.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\cache\ftcache.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\base\ftfntfmt.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\base\ftfstype.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\base\ftgasp.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\base\ftglyph.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\base\ftgxval.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\base\ftinit.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\base\ftlcdfil.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\lzw\ftlzw.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\base\ftmm.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\base\ftotval.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\base\ftpatent.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\base\ftpfr.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\base\ftstroke.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\base\ftsynth.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\base\ftsystem.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\base\fttype1.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\base\ftwinfnt.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\pcf\pcf.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\pfr\pfr.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\psaux\psaux.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\pshinter\pshinter.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\psnames\psmodule.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\raster\raster.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\sfnt\sfnt.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\smooth\smooth.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\truetype\truetype.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\type1\type1.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\cid\type1cid.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\type42\type42.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\winfonts\winfnt.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\freetype\gzip\ftgzip.c">
<Filter>Source Files\freetype</Filter>
</ClCompile>
<ClCompile Include="..\src\lib_ccx\ccx_encoders_spupng.c">
<Filter>Source Files\ccx_encoders</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\src\lib_ccx\ccx_sub_entry_message.proto">