Initial community commit

This commit is contained in:
Jef
2024-09-24 14:54:57 +02:00
parent 537bcbc862
commit 20d28e80a5
16810 changed files with 4640254 additions and 2 deletions

View File

@ -0,0 +1,53 @@
From 47eb8d07a8caaa6cc1e6e906a7cd5b44ee0fb624 Mon Sep 17 00:00:00 2001
From: Mikhail Paulyshka <me@mixaill.tk>
Date: Thu, 27 Jul 2017 04:24:36 +0300
Subject: [PATCH] remove redundant assignments
---
lib/tokenize.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/lib/tokenize.c b/lib/tokenize.c
index 57b7aa8..3f53fb5 100644
--- a/lib/tokenize.c
+++ b/lib/tokenize.c
@@ -487,11 +487,11 @@ int oc_enc_tokenize_ac(oc_enc_ctx *_enc,int _pli,ptrdiff_t _fragi,
zzj=64;
for(zzi=OC_MINI(_zzi,63);zzi>0;zzi--){
ogg_uint32_t best_cost;
- int best_bits=best_bits;
- int best_next=best_next;
- int best_token=best_token;
- int best_eb=best_eb;
- int best_qc=best_qc;
+ int best_bits;
+ int best_next;
+ int best_token;
+ int best_eb;
+ int best_qc;
ogg_uint32_t d2;
int dq;
int qc_m;
@@ -1091,8 +1091,8 @@ void oc_enc_tokenize_dc_frag_list(oc_enc_ctx *_enc,int _pli,
int neobs1;
int token;
int eb;
- int token1=token1;
- int eb1=eb1;
+ int token1;
+ int eb1;
/*Return immediately if there are no coded fragments; otherwise we'd flush
any trailing EOB run into the AC 1 list and never read it back out.*/
if(_ncoded_fragis<=0)return;
@@ -1328,7 +1328,7 @@ void oc_enc_tokenize_finish(oc_enc_ctx *_enc){
int new_eb;
int zzj;
int plj;
- ptrdiff_t ti=ti;
+ ptrdiff_t ti;
int run_count;
/*Make sure this coefficient has tokens at all.*/
if(_enc->ndct_tokens[pli][zzi]<=0)continue;
--
2.12.2.windows.2

View File

@ -0,0 +1,114 @@
cmake_minimum_required(VERSION 3.0)
project(theora LANGUAGES C)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}")
FIND_PACKAGE(Ogg REQUIRED)
file(GLOB HEADERS
"include/theora/codec.h"
"include/theora/theora.h"
"include/theora/theoradec.h"
"include/theora/theoraenc.h"
)
set(LIBTHEORA_COMMON
"lib/apiwrapper.c"
"lib/bitpack.c"
"lib/dequant.c"
"lib/fragment.c"
"lib/idct.c"
"lib/info.c"
"lib/internal.c"
"lib/state.c"
"lib/quant.c"
"lib/x86_vc/mmxfrag.c"
"lib/x86_vc/mmxidct.c"
"lib/x86_vc/mmxstate.c"
"lib/x86_vc/x86cpu.c"
"lib/x86_vc/x86state.c"
)
set(LIBTHEORA_ENC
"lib/analyze.c"
"lib/encapiwrapper.c"
"lib/encfrag.c"
"lib/encinfo.c"
"lib/encode.c"
"lib/enquant.c"
"lib/fdct.c"
"lib/huffenc.c"
"lib/mathops.c"
"lib/mcenc.c"
"lib/rate.c"
"lib/tokenize.c"
"lib/x86_vc/mmxencfrag.c"
"lib/x86_vc/mmxfdct.c"
"lib/x86_vc/x86enc.c"
)
set(LIBTHEORA_DEC
"lib/decapiwrapper.c"
"lib/decinfo.c"
"lib/decode.c"
"lib/huffdec.c"
)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
option(USE_X86 "Use x86 optimization" OFF)
if(USE_X86)
add_definitions(-DOC_X86_ASM)
endif()
if (BUILD_SHARED_LIBS)
add_definitions(-DLIBTHEORA_EXPORTS)
endif()
add_library(theora-common OBJECT ${LIBTHEORA_COMMON} ${HEADERS})
target_link_libraries(theora-common PUBLIC Ogg::ogg)
target_include_directories(theora-common PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
add_library(theora-enc OBJECT ${LIBTHEORA_ENC} ${HEADERS})
target_link_libraries(theora-enc PUBLIC Ogg::ogg)
target_include_directories(theora-enc PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
add_library(theora-dec OBJECT ${LIBTHEORA_DEC} ${HEADERS})
target_link_libraries(theora-dec PUBLIC Ogg::ogg)
target_include_directories(theora-dec PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
add_library(theora $<TARGET_OBJECTS:theora-common> $<TARGET_OBJECTS:theora-enc> $<TARGET_OBJECTS:theora-dec> "libtheora.def")
target_link_libraries(theora PUBLIC Ogg::ogg)
target_include_directories(theora PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
add_library(theoraenc $<TARGET_OBJECTS:theora-common> $<TARGET_OBJECTS:theora-enc> "win32/xmingw32/libtheoraenc-all.def")
target_link_libraries(theoraenc PUBLIC Ogg::ogg)
target_include_directories(theoraenc PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
add_library(theoradec $<TARGET_OBJECTS:theora-common> $<TARGET_OBJECTS:theora-dec> "win32/xmingw32/libtheoradec-all.def")
target_link_libraries(theoradec PUBLIC Ogg::ogg)
target_include_directories(theoradec PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
include(CMakePackageConfigHelpers)
configure_package_config_file(unofficial-theora-config.cmake.in unofficial-theora-config.cmake
INSTALL_DESTINATION "lib/unofficial-theora")
install(FILES ${HEADERS} DESTINATION include/theora)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/unofficial-theora-config.cmake"
DESTINATION "lib/unofficial-theora"
)
install(TARGETS theora theoraenc theoradec
EXPORT unofficial-theora-targets
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)
install(EXPORT unofficial-theora-targets
NAMESPACE unofficial::theora::
DESTINATION "lib/unofficial-theora"
)

View File

@ -0,0 +1,61 @@
EXPORTS
; Old alpha API
theora_version_string
theora_version_number
theora_decode_header
theora_decode_init
theora_decode_packetin
theora_decode_YUVout
theora_control
theora_packet_isheader
theora_packet_iskeyframe
theora_granule_shift
theora_granule_frame
theora_granule_time
theora_info_init
theora_info_clear
theora_clear
theora_comment_init
theora_comment_add
theora_comment_add_tag
theora_comment_query
theora_comment_query_count
theora_comment_clear
; New theora-exp API
th_version_string
th_version_number
th_decode_headerin
th_decode_alloc
th_setup_free
th_decode_ctl
th_decode_packetin
th_decode_ycbcr_out
th_decode_free
th_packet_isheader
th_packet_iskeyframe
th_granule_frame
th_granule_time
th_info_init
th_info_clear
th_comment_init
th_comment_add
th_comment_add_tag
th_comment_query
th_comment_query_count
th_comment_clear
; Old alpha API
theora_encode_init
theora_encode_YUVin
theora_encode_packetout
theora_encode_header
theora_encode_comment
theora_encode_tables
; New theora-exp API
th_encode_alloc
th_encode_ctl
th_encode_flushheader
th_encode_ycbcr_in
th_encode_packetout
th_encode_free
TH_VP31_QUANT_INFO
TH_VP31_HUFF_CODES

View File

@ -0,0 +1,34 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO xiph/theora
REF fa5707d68c2a4338d58aa8b6afc95539ba89fecb
SHA512 e33da23a17e93709dfe4421b512cedbd9aab0d706f5650e0436f9c8e1cde76b902c3338d46750bb86d83e1bceb111ee84e90df36fb59b5c2e7f7aee1610752b2
HEAD_REF master
PATCHES
0001-fix-uwp.patch
)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
file(COPY "${CMAKE_CURRENT_LIST_DIR}/libtheora.def" DESTINATION "${SOURCE_PATH}")
file(COPY "${CMAKE_CURRENT_LIST_DIR}/unofficial-theora-config.cmake.in" DESTINATION "${SOURCE_PATH}")
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(THEORA_X86_OPT ON)
else()
set(THEORA_X86_OPT OFF)
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DUSE_X86=${THEORA_X86_OPT}
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/unofficial-theora")
vcpkg_copy_pdbs()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING" "${SOURCE_PATH}/LICENSE")

View File

@ -0,0 +1,3 @@
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/unofficial-theora-targets.cmake")

View File

@ -0,0 +1,19 @@
{
"name": "libtheora",
"version-string": "1.2.0alpha1-20170719",
"port-version": 4,
"description": "Theora is a free and open video compression format from the Xiph.org Foundation.",
"homepage": "https://github.com/xiph/theora",
"license": null,
"dependencies": [
"libogg",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}