Projects
Essentials
libde265
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 9
View file
libde265.changes
Changed
@@ -1,4 +1,32 @@ ------------------------------------------------------------------- +Mon Jul 22 17:25:31 UTC 2024 - Bjørn Lie <zaitor@opensuse.org> + +- Update to version 1.0.15: + * A couple of bug fixes, including the following CVEs: + - CVE-2023-49465 + - CVE-2023-49467 + - CVE-2023-49468 +- Changes from version 1.0.14: + * This fixes build-time SSE detection when using the CMake build + system. No other changes than that. You don't need to update if + you are using the autotools build system. +- Changes from version 1.0.13: + * This release fixes among other smaller issues the following + crashes: + - SEGV:occured in function main at dec265.cc + - Memory allocation failed in function main at dec265.cc + - Buffer over-read causes segmentation fault in + pic_parameter_set::dump + - Potential segmentation fault due to incorrect realloc in CABA + C_encoder_bitstream::check_size_and_resize (unused function) + - SEGV in libde265 in slice_segment_header::dump_slice_segment_ + header + - Libde265 v1.0.12 was discovered that requested allocation + size exceeds maximum supported size of 0x10000000000 + - heap-buffer-overflow in derive_spatial_luma_vector_prediction + (...) + +------------------------------------------------------------------- Wed Oct 18 15:28:34 UTC 2023 - Bjørn Lie <zaitor@opensuse.org> - Update to version 1.0.12:
View file
libde265.spec
Changed
@@ -18,7 +18,7 @@ %define so_ver 0 Name: libde265 -Version: 1.0.12 +Version: 1.0.15 Release: 0 Summary: Open H.265 video codec implementation License: LGPL-3.0-only
View file
libde265-1.0.12.tar.gz/dec265/hdrcopy.cc
Deleted
@@ -1,124 +0,0 @@ -/* - libde265 example application. - - MIT License - - Copyright (c) 2013-2014 struktur AG, Dirk Farin <farin@struktur.de> - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - - -#include "libde265/nal-parser.h" -#include "libde265/decctx.h" -#include <assert.h> - -error_queue errqueue; - -video_parameter_set vps; -seq_parameter_set sps; -pic_parameter_set pps; - -CABAC_encoder_bitstream writer; - - -void process_nal(NAL_unit* nal) -{ - de265_error err = DE265_OK; - - bitreader reader; - bitreader_init(&reader, nal->data(), nal->size()); - - nal_header nal_hdr; - nal_hdr.read(&reader); - writer.write_startcode(); - nal_hdr.write(writer); - - printf("NAL: 0x%x 0x%x - unit type:%s temporal id:%d\n", - nal->data()0, nal->data()1, - get_NAL_name(nal_hdr.nal_unit_type), - nal_hdr.nuh_temporal_id); - - - if (nal_hdr.nal_unit_type<32) { - //err = read_slice_NAL(reader, nal, nal_hdr); - } - else switch (nal_hdr.nal_unit_type) { - case NAL_UNIT_VPS_NUT: - vps.read(&errqueue, &reader); - vps.dump(1); - vps.write(&errqueue, writer); - writer.flush_VLC(); - break; - - case NAL_UNIT_SPS_NUT: - sps.read(&errqueue, &reader); - sps.dump(1); - sps.write(&errqueue, writer); - writer.flush_VLC(); - break; - - case NAL_UNIT_PPS_NUT: - //err = read_pps_NAL(reader); - break; - - case NAL_UNIT_PREFIX_SEI_NUT: - case NAL_UNIT_SUFFIX_SEI_NUT: - //err = read_sei_NAL(reader, nal_hdr.nal_unit_type==NAL_UNIT_SUFFIX_SEI_NUT); - break; - - case NAL_UNIT_EOS_NUT: - //ctx->FirstAfterEndOfSequenceNAL = true; - break; - } -} - - -int main(int argc, char** argv) -{ - NAL_Parser nal_parser; - - FILE* fh = fopen(argv1,"rb"); - unsigned char buf1024; - - writer.write_bits(0,8); // because HM has an extra byte at the beginning - - while(!feof(fh)) - { - int n = fread(buf,1,1024,fh); - if (n>0) { - nal_parser.push_data(buf,n, 0); - } - - if (nal_parser.get_NAL_queue_length()>0) { - NAL_unit* nal = nal_parser.pop_from_NAL_queue(); - assert(nal); - process_nal(nal); - nal_parser.free_NAL_unit(nal); - } - } - - fclose(fh); - - fh = fopen("out.bin","wb"); - fwrite(writer.data(), 1,writer.size(), fh); - fclose(fh); - - return 0; -}
View file
libde265-1.0.12.tar.gz/CMakeLists.txt -> libde265-1.0.15.tar.gz/CMakeLists.txt
Changed
@@ -2,7 +2,7 @@ project (libde265 LANGUAGES C CXX - VERSION 1.0.12 + VERSION 1.0.15 ) set(CMAKE_CXX_STANDARD 11) @@ -11,7 +11,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) # The version number. -set (NUMERIC_VERSION 0x01001200) +set (NUMERIC_VERSION 0x01001500) set (PACKAGE_VERSION ${PROJECT_VERSION}) include (${CMAKE_ROOT}/Modules/CheckCCompilerFlag.cmake) @@ -23,7 +23,7 @@ option(ENABLE_SDL "Enable SDL" ON) if (ENABLE_SDL) - find_package(SDL) + find_package(SDL2) endif() find_package(Threads REQUIRED) @@ -44,7 +44,13 @@ add_definitions(-Wall) endif() -option(DISABLE_SSE "Disable SSE optimizations" OFF) +include(CheckCXXSymbolExists) +check_cxx_symbol_exists(_LIBCPP_VERSION cstdlib HAVE_LIBCPP) +if(HAVE_LIBCPP) + set(LIBS_PRIVATE "-lc++") +else() + set(LIBS_PRIVATE "-lstdc++") +endif() option(BUILD_SHARED_LIBS "Build shared library" ON) if(NOT BUILD_SHARED_LIBS)
View file
libde265-1.0.12.tar.gz/README.md -> libde265-1.0.15.tar.gz/README.md
Changed
@@ -60,7 +60,7 @@ libde265 has no dependencies on other libraries, but both optional example programs have dependencies on: -- SDL (optional for dec265's YUV overlay output), +- SDL2 (optional for dec265's YUV overlay output), - Qt (required for sherlock265), @@ -146,6 +146,11 @@ - libde265.js JavaScript decoder source(https://github.com/strukturag/libde265.js), demo(https://strukturag.github.io/libde265.js/). +## Packaging status + +!libde265 packaging status(https://repology.org/badge/vertical-allrepos/libde265.svg?exclude_unsupported=1&columns=3&exclude_sources=modules,site&header=libde265%20packaging%20status)(https://repology.org/project/libheif/versions) + + License ======= @@ -155,5 +160,8 @@ See `COPYING` for more details. +The short video clip in the 'testdata' directory is from the movie 'Girl Shy', which is in the public domain. + Copyright (c) 2013-2014 Struktur AG -Contact: Dirk Farin <farin@struktur.de> +Copyright (c) 2013-2023 Dirk Farin +Contact: Dirk Farin <dirk.farin@gmail.com>
View file
libde265-1.0.12.tar.gz/config.h.in -> libde265-1.0.15.tar.gz/config.h.in
Changed
@@ -57,7 +57,7 @@ /* Define to 1 if the system has the type `ptrdiff_t'. */ #undef HAVE_PTRDIFF_T -/* Whether libsdl was found. */ +/* Whether libsdl2 was found. */ #undef HAVE_SDL /* Define to 1 if you have the <setjmp.h> header file. */
View file
libde265-1.0.12.tar.gz/configure -> libde265-1.0.15.tar.gz/configure
Changed
@@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for libde265 1.0.12. +# Generated by GNU Autoconf 2.71 for libde265 1.0.15. # # Report bugs to <dirk.farin@gmail.com>. # @@ -621,8 +621,8 @@ # Identity of this package. PACKAGE_NAME='libde265' PACKAGE_TARNAME='libde265' -PACKAGE_VERSION='1.0.12' -PACKAGE_STRING='libde265 1.0.12' +PACKAGE_VERSION='1.0.15' +PACKAGE_STRING='libde265 1.0.15' PACKAGE_BUGREPORT='dirk.farin@gmail.com' PACKAGE_URL='' @@ -1437,7 +1437,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libde265 1.0.12 to adapt to many kinds of systems. +\`configure' configures libde265 1.0.15 to adapt to many kinds of systems. Usage: $0 OPTION... VAR=VALUE... @@ -1509,7 +1509,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libde265 1.0.12:";; + short | recursive ) echo "Configuration of libde265 1.0.15:";; esac cat <<\_ACEOF @@ -1651,7 +1651,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libde265 configure 1.0.12 +libde265 configure 1.0.15 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -2263,7 +2263,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libde265 $as_me 1.0.12, which was +It was created by libde265 $as_me 1.0.15, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3240,7 +3240,7 @@ ac_config_headers="$ac_config_headers config.h" -NUMERIC_VERSION=0x01001200 # Numeric representation of the version (A.B.C.D = 0xAABBCCDD) +NUMERIC_VERSION=0x01001500 # Numeric representation of the version (A.B.C.D = 0xAABBCCDD) # From https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html: @@ -3250,7 +3250,7 @@ # If any interfaces have been removed or changed since the last public release, then set age to 0. LIBDE265_CURRENT=1 -LIBDE265_REVISION=5 +LIBDE265_REVISION=8 LIBDE265_AGE=1 # --------------------------------------------------------------------------- @@ -17714,7 +17714,7 @@ # Define the identity of the package. PACKAGE='libde265' - VERSION='1.0.12' + VERSION='1.0.15' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -20050,19 +20050,19 @@ if eval "test x$enable_dec265 = xyes" ; then pkg_failed=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sdl" >&5 -printf %s "checking for sdl... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sdl2" >&5 +printf %s "checking for sdl2... " >&6; } if test -n "$SDL_CFLAGS"; then pkg_cv_SDL_CFLAGS="$SDL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl\""; } >&5 - ($PKG_CONFIG --exists --print-errors "sdl") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "sdl2") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SDL_CFLAGS=`$PKG_CONFIG --cflags "sdl" 2>/dev/null` + pkg_cv_SDL_CFLAGS=`$PKG_CONFIG --cflags "sdl2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -20074,12 +20074,12 @@ pkg_cv_SDL_LIBS="$SDL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl\""; } >&5 - ($PKG_CONFIG --exists --print-errors "sdl") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "sdl2") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SDL_LIBS=`$PKG_CONFIG --libs "sdl" 2>/dev/null` + pkg_cv_SDL_LIBS=`$PKG_CONFIG --libs "sdl2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -20100,9 +20100,9 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - SDL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "sdl" 2>&1` + SDL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "sdl2" 2>&1` else - SDL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "sdl" 2>&1` + SDL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "sdl2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SDL_PKG_ERRORS" >&5 @@ -20235,8 +20235,8 @@ if eval "test $enable_dec265 = yes" && eval "test $have_videogfx != yes" && eval "test $have_sdl != yes" ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Did not find libvideogfx or libsdl, video output of dec265 will be disabled." >&5 -printf "%s\n" "$as_me: WARNING: Did not find libvideogfx or libsdl, video output of dec265 will be disabled." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Did not find libvideogfx or libsdl2, video output of dec265 will be disabled." >&5 +printf "%s\n" "$as_me: WARNING: Did not find libvideogfx or libsdl2, video output of dec265 will be disabled." >&2;} fi if eval "test $enable_sherlock265 = yes" && eval "test $have_videogfx != yes" && eval "test $have_swscale != yes" ; then @@ -21196,7 +21196,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libde265 $as_me 1.0.12, which was +This file was extended by libde265 $as_me 1.0.15, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -21264,7 +21264,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -libde265 config.status 1.0.12 +libde265 config.status 1.0.15 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\"
View file
libde265-1.0.12.tar.gz/configure.ac -> libde265-1.0.15.tar.gz/configure.ac
Changed
@@ -2,11 +2,11 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.68) -AC_INIT(libde265, 1.0.12, dirk.farin@gmail.com) +AC_INIT(libde265, 1.0.15, dirk.farin@gmail.com) AC_CONFIG_SRCDIR(libde265/de265.cc) AC_CONFIG_HEADERS(config.h) -NUMERIC_VERSION=0x01001200 # Numeric representation of the version (A.B.C.D = 0xAABBCCDD) +NUMERIC_VERSION=0x01001500 # Numeric representation of the version (A.B.C.D = 0xAABBCCDD) AC_SUBST(NUMERIC_VERSION) # From https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html: @@ -16,7 +16,7 @@ # If any interfaces have been removed or changed since the last public release, then set age to 0. LIBDE265_CURRENT=1 -LIBDE265_REVISION=5 +LIBDE265_REVISION=8 LIBDE265_AGE=1 # --------------------------------------------------------------------------- @@ -308,8 +308,8 @@ fi if eval "test x$enable_dec265 = xyes" ; then - PKG_CHECK_MODULES(SDL, sdl, - AC_DEFINE(HAVE_SDL, 1, Whether libsdl was found.) + PKG_CHECK_MODULES(SDL, sdl2, + AC_DEFINE(HAVE_SDL, 1, Whether libsdl2 was found.) AC_SUBST(SDL_CFLAGS) AC_SUBST(SDL_LIBS) have_sdl="yes", @@ -332,7 +332,7 @@ AM_CONDITIONAL(HAVE_SDL, test "x$have_sdl" = "xyes") if eval "test $enable_dec265 = yes" && eval "test $have_videogfx != yes" && eval "test $have_sdl != yes" ; then - AC_MSG_WARN(Did not find libvideogfx or libsdl, video output of dec265 will be disabled.) + AC_MSG_WARN(Did not find libvideogfx or libsdl2, video output of dec265 will be disabled.) fi if eval "test $enable_sherlock265 = yes" && eval "test $have_videogfx != yes" && eval "test $have_swscale != yes" ; then
View file
libde265-1.0.12.tar.gz/dec265/CMakeLists.txt -> libde265-1.0.15.tar.gz/dec265/CMakeLists.txt
Changed
@@ -2,15 +2,15 @@ target_link_libraries (dec265 PRIVATE de265) -if(SDL_FOUND) +if(SDL2_FOUND) target_sources(dec265 PRIVATE sdl.cc) target_compile_definitions(dec265 PRIVATE HAVE_SDL) - target_include_directories (dec265 PRIVATE "${SDL_INCLUDE_DIR}") - target_link_libraries (dec265 PRIVATE ${SDL_LIBRARY}) + target_include_directories (dec265 PRIVATE "${SDL2_INCLUDE_DIRS}") + target_link_libraries (dec265 PRIVATE ${SDL2_LIBRARIES}) endif() if(MSVC) - target_sources(dec265 PRIVATE + target_sources(dec265 PRIVATE ../extra/getopt.c ../extra/getopt_long.c ) @@ -18,11 +18,11 @@ install (TARGETS dec265 DESTINATION ${CMAKE_INSTALL_BINDIR}) -if(NOT MSVC) - # hdrcopy uses internal APIs that are not available when compiled for Windows - add_executable (hdrcopy hdrcopy.cc) - - target_link_libraries (hdrcopy PRIVATE de265) - - install (TARGETS hdrcopy DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif() +#if(NOT MSVC) +# # hdrcopy uses internal APIs that are not available when compiled for Windows +# add_executable (hdrcopy hdrcopy.cc) +# +# target_link_libraries (hdrcopy PRIVATE de265) +# +# install (TARGETS hdrcopy DESTINATION ${CMAKE_INSTALL_BINDIR}) +#endif()
View file
libde265-1.0.12.tar.gz/dec265/Makefile.am -> libde265-1.0.15.tar.gz/dec265/Makefile.am
Changed
@@ -1,5 +1,5 @@ -bin_PROGRAMS = dec265 hdrcopy +bin_PROGRAMS = dec265 # hdrcopy AM_CPPFLAGS = -I$(top_srcdir)/libde265 -I$(top_srcdir) @@ -9,11 +9,11 @@ dec265_LDADD = ../libde265/libde265.la -lstdc++ dec265_SOURCES = dec265.cc -hdrcopy_DEPENDENCIES = ../libde265/libde265.la -hdrcopy_CXXFLAGS = -hdrcopy_LDFLAGS = -hdrcopy_LDADD = ../libde265/libde265.la -lstdc++ -hdrcopy_SOURCES = hdrcopy.cc +# hdrcopy_DEPENDENCIES = ../libde265/libde265.la +# hdrcopy_CXXFLAGS = +# hdrcopy_LDFLAGS = +# hdrcopy_LDADD = ../libde265/libde265.la -lstdc++ +# hdrcopy_SOURCES = hdrcopy.cc if HAVE_VIDEOGFX dec265_CXXFLAGS += $(VIDEOGFX_CFLAGS)
View file
libde265-1.0.12.tar.gz/dec265/Makefile.in -> libde265-1.0.15.tar.gz/dec265/Makefile.in
Changed
@@ -89,7 +89,13 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -bin_PROGRAMS = dec265$(EXEEXT) hdrcopy$(EXEEXT) +bin_PROGRAMS = dec265$(EXEEXT) + +# hdrcopy_DEPENDENCIES = ../libde265/libde265.la +# hdrcopy_CXXFLAGS = +# hdrcopy_LDFLAGS = +# hdrcopy_LDADD = ../libde265/libde265.la -lstdc++ +# hdrcopy_SOURCES = hdrcopy.cc @HAVE_VIDEOGFX_TRUE@am__append_1 = $(VIDEOGFX_CFLAGS) @HAVE_VIDEOGFX_TRUE@am__append_2 = $(VIDEOGFX_LIBS) @HAVE_SDL_TRUE@am__append_3 = $(SDL_CFLAGS) @@ -125,11 +131,6 @@ dec265_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(dec265_CXXFLAGS) \ $(CXXFLAGS) $(dec265_LDFLAGS) $(LDFLAGS) -o $@ -am_hdrcopy_OBJECTS = hdrcopy-hdrcopy.$(OBJEXT) -hdrcopy_OBJECTS = $(am_hdrcopy_OBJECTS) -hdrcopy_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(hdrcopy_CXXFLAGS) \ - $(CXXFLAGS) $(hdrcopy_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -146,7 +147,7 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/dec265-dec265.Po \ - ./$(DEPDIR)/dec265-sdl.Po ./$(DEPDIR)/hdrcopy-hdrcopy.Po + ./$(DEPDIR)/dec265-sdl.Po am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) @@ -184,8 +185,8 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(dec265_SOURCES) $(hdrcopy_SOURCES) -DIST_SOURCES = $(am__dec265_SOURCES_DIST) $(hdrcopy_SOURCES) +SOURCES = $(dec265_SOURCES) +DIST_SOURCES = $(am__dec265_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -365,11 +366,6 @@ dec265_LDFLAGS = $(am__append_2) $(am__append_4) $(am__append_6) dec265_LDADD = ../libde265/libde265.la -lstdc++ dec265_SOURCES = dec265.cc $(am__append_5) -hdrcopy_DEPENDENCIES = ../libde265/libde265.la -hdrcopy_CXXFLAGS = -hdrcopy_LDFLAGS = -hdrcopy_LDADD = ../libde265/libde265.la -lstdc++ -hdrcopy_SOURCES = hdrcopy.cc EXTRA_DIST = Makefile.vc7 \ CMakeLists.txt \ ../extra/getopt.c \ @@ -463,10 +459,6 @@ @rm -f dec265$(EXEEXT) $(AM_V_CXXLD)$(dec265_LINK) $(dec265_OBJECTS) $(dec265_LDADD) $(LIBS) -hdrcopy$(EXEEXT): $(hdrcopy_OBJECTS) $(hdrcopy_DEPENDENCIES) $(EXTRA_hdrcopy_DEPENDENCIES) - @rm -f hdrcopy$(EXEEXT) - $(AM_V_CXXLD)$(hdrcopy_LINK) $(hdrcopy_OBJECTS) $(hdrcopy_LDADD) $(LIBS) - mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -475,7 +467,6 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec265-dec265.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dec265-sdl.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hdrcopy-hdrcopy.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @@ -532,20 +523,6 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dec265_CXXFLAGS) $(CXXFLAGS) -c -o dec265-sdl.obj `if test -f 'sdl.cc'; then $(CYGPATH_W) 'sdl.cc'; else $(CYGPATH_W) '$(srcdir)/sdl.cc'; fi` -hdrcopy-hdrcopy.o: hdrcopy.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hdrcopy_CXXFLAGS) $(CXXFLAGS) -MT hdrcopy-hdrcopy.o -MD -MP -MF $(DEPDIR)/hdrcopy-hdrcopy.Tpo -c -o hdrcopy-hdrcopy.o `test -f 'hdrcopy.cc' || echo '$(srcdir)/'`hdrcopy.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hdrcopy-hdrcopy.Tpo $(DEPDIR)/hdrcopy-hdrcopy.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='hdrcopy.cc' object='hdrcopy-hdrcopy.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hdrcopy_CXXFLAGS) $(CXXFLAGS) -c -o hdrcopy-hdrcopy.o `test -f 'hdrcopy.cc' || echo '$(srcdir)/'`hdrcopy.cc - -hdrcopy-hdrcopy.obj: hdrcopy.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hdrcopy_CXXFLAGS) $(CXXFLAGS) -MT hdrcopy-hdrcopy.obj -MD -MP -MF $(DEPDIR)/hdrcopy-hdrcopy.Tpo -c -o hdrcopy-hdrcopy.obj `if test -f 'hdrcopy.cc'; then $(CYGPATH_W) 'hdrcopy.cc'; else $(CYGPATH_W) '$(srcdir)/hdrcopy.cc'; fi` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/hdrcopy-hdrcopy.Tpo $(DEPDIR)/hdrcopy-hdrcopy.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='hdrcopy.cc' object='hdrcopy-hdrcopy.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hdrcopy_CXXFLAGS) $(CXXFLAGS) -c -o hdrcopy-hdrcopy.obj `if test -f 'hdrcopy.cc'; then $(CYGPATH_W) 'hdrcopy.cc'; else $(CYGPATH_W) '$(srcdir)/hdrcopy.cc'; fi` - mostlyclean-libtool: -rm -f *.lo @@ -680,7 +657,6 @@ distclean: distclean-am -rm -f ./$(DEPDIR)/dec265-dec265.Po -rm -f ./$(DEPDIR)/dec265-sdl.Po - -rm -f ./$(DEPDIR)/hdrcopy-hdrcopy.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -728,7 +704,6 @@ maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/dec265-dec265.Po -rm -f ./$(DEPDIR)/dec265-sdl.Po - -rm -f ./$(DEPDIR)/hdrcopy-hdrcopy.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic
View file
libde265-1.0.12.tar.gz/dec265/dec265.cc -> libde265-1.0.15.tar.gz/dec265/dec265.cc
Changed
@@ -55,10 +55,15 @@ #include "sdl.hh" #endif +#ifndef PRIu32 +#define PRIu32 "u" +#endif #define BUFFER_SIZE 40960 #define NUM_THREADS 4 +const uint32_t kSecurityLimit_MaxNALSize = 100 * 1024 * 1024; // 100 MB + int nThreads=0; bool nal_input=false; int quiet=0; @@ -666,6 +671,10 @@ if (measure_quality) { reference_file = fopen(reference_filename, "rb"); + if (reference_file == nullptr) { + fprintf(stderr, "Error: cannot create measurement output file '%s'\n", reference_filename); + exit(5); + } } @@ -703,20 +712,31 @@ if (nal_input) { uint8_t len4; int n = fread(len,1,4,fh); - int length = (len0<<24) + (len1<<16) + (len2<<8) + len3; - - uint8_t* buf = (uint8_t*)malloc(length); - n = fread(buf,1,length,fh); - err = de265_push_NAL(ctx, buf,n, pos, (void*)1); - - if (write_bytestream) { - uint8_t sc3 = { 0,0,1 }; - fwrite(sc ,1,3,bytestream_fh); - fwrite(buf,1,n,bytestream_fh); - } - - free(buf); - pos+=n; + uint32_t length = (len0<<24) + (len1<<16) + (len2<<8) + len3; + + if (length > kSecurityLimit_MaxNALSize) { + fprintf(stderr, "NAL packet with size %" PRIu32 " exceeds security limit %" PRIu32 ", skipping this NAL.\n", + length, + kSecurityLimit_MaxNALSize); + + fseek(fh, length, SEEK_CUR); + + pos += length; + } + else { + uint8_t* buf = (uint8_t*)malloc(length); + n = fread(buf,1,length,fh); + err = de265_push_NAL(ctx, buf,n, pos, (void*)1); + + if (write_bytestream) { + uint8_t sc3 = { 0,0,1 }; + fwrite(sc ,1,3,bytestream_fh); + fwrite(buf,1,n,bytestream_fh); + } + + free(buf); + pos+=n; + } } else { // read a chunk of input data
View file
libde265-1.0.12.tar.gz/dec265/sdl.cc -> libde265-1.0.15.tar.gz/dec265/sdl.cc
Changed
@@ -37,51 +37,49 @@ mChroma = chroma; - if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) < 0 ) { + if (SDL_Init(SDL_INIT_VIDEO) < 0 ) { printf("SDL_Init() failed: %s\n", SDL_GetError( ) ); SDL_Quit(); return false; } - const SDL_VideoInfo* info = SDL_GetVideoInfo(); - if( !info ) { - printf("SDL_GetVideoInfo() failed: %s\n", SDL_GetError() ); + // set window title + const char *window_title = "SDL YUV display"; + mWindow = SDL_CreateWindow(window_title, + SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, + frame_width, frame_height, 0); + if (!mWindow) { + printf("SDL: Couldn't set video mode to %dx%d: %s\n", + frame_width, frame_height, SDL_GetError()); SDL_Quit(); return false; } - Uint8 bpp = info->vfmt->BitsPerPixel; - - Uint32 vflags; - if (info->hw_available) - vflags = SDL_HWSURFACE; - else - vflags = SDL_SWSURFACE; - - // set window title - const char *window_title = "SDL YUV display"; - SDL_WM_SetCaption(window_title, NULL); - - mScreen = SDL_SetVideoMode(frame_width, frame_height, bpp, vflags); - if (mScreen == NULL) { - printf("SDL: Couldn't set video mode to %dx%d,%d bpp: %s", - frame_width, frame_height, bpp, SDL_GetError()); + Uint32 flags = 0; // Empty flags prioritize SDL_RENDERER_ACCELERATED. + mRenderer = SDL_CreateRenderer(mWindow, -1, flags); + if (!mRenderer) { + printf("SDL: Couldn't create renderer: %s\n", SDL_GetError()); SDL_Quit(); return false; } - uint32_t pixelFormat; + Uint32 pixelFormat = 0; switch (mChroma) { - case SDL_CHROMA_MONO: pixelFormat = SDL_YV12_OVERLAY; break; - case SDL_CHROMA_420: pixelFormat = SDL_YV12_OVERLAY; break; - case SDL_CHROMA_422: pixelFormat = SDL_YUY2_OVERLAY; break; - case SDL_CHROMA_444: pixelFormat = SDL_YV12_OVERLAY; break; - //case SDL_CHROMA_444: pixelFormat = SDL_YUY2_OVERLAY; break; + case SDL_CHROMA_MONO: pixelFormat = SDL_PIXELFORMAT_YV12; break; + case SDL_CHROMA_420: pixelFormat = SDL_PIXELFORMAT_YV12; break; + case SDL_CHROMA_422: pixelFormat = SDL_PIXELFORMAT_YV12; break; + case SDL_CHROMA_444: pixelFormat = SDL_PIXELFORMAT_YV12; break; + //case SDL_CHROMA_444: pixelFormat = SDL_PIXELFORMAT_YV12; break; + default: + printf("Unsupported chroma: %d\n", mChroma); + SDL_Quit(); + return false; } - mYUVOverlay = SDL_CreateYUVOverlay(frame_width, frame_height, pixelFormat, mScreen); - if (mYUVOverlay == NULL ) { - printf("SDL: Couldn't create SDL YUV overlay: %s",SDL_GetError()); + mTexture = SDL_CreateTexture(mRenderer, pixelFormat, + SDL_TEXTUREACCESS_STREAMING, frame_width, frame_height); + if (!mTexture ) { + printf("SDL: Couldn't create SDL texture: %s\n", SDL_GetError()); SDL_Quit(); return false; } @@ -102,7 +100,8 @@ int stride, int chroma_stride) { if (!mWindowOpen) return; - if (SDL_LockYUVOverlay(mYUVOverlay) < 0) return; + if (SDL_LockTexture(mTexture, nullptr, + reinterpret_cast<void**>(&mPixels), &mStride) < 0) return; if (mChroma == SDL_CHROMA_420) { display420(Y,U,V,stride,chroma_stride); @@ -118,9 +117,10 @@ display400(Y,stride); } - SDL_UnlockYUVOverlay(mYUVOverlay); + SDL_UnlockTexture(mTexture); - SDL_DisplayYUVOverlay(mYUVOverlay, &rect); + SDL_RenderCopy(mRenderer, mTexture, nullptr, nullptr); + SDL_RenderPresent(mRenderer); } @@ -129,26 +129,31 @@ const unsigned char *V, int stride, int chroma_stride) { - if (stride == rect.w && chroma_stride == rect.w/2) { + if (stride == mStride && chroma_stride == mStride/2) { // fast copy - memcpy(mYUVOverlay->pixels0, Y, rect.w * rect.h); - memcpy(mYUVOverlay->pixels1, V, rect.w * rect.h / 4); - memcpy(mYUVOverlay->pixels2, U, rect.w * rect.h / 4); + memcpy(mPixels, Y, rect.w * rect.h); + memcpy(&mPixelsrect.w * rect.h, V, rect.w * rect.h / 4); + memcpy(&mPixels(rect.w * rect.h) + (rect.w * rect.h / 4), U, rect.w * rect.h / 4); } else { // copy line by line, because sizes are different + uint8_t *dest = mPixels; + + for (int y=0;y<rect.h;y++,dest+=mStride) + { + memcpy(dest, Y+stride*y, rect.w); + } - for (int y=0;y<rect.h;y++) + for (int y=0;y<rect.h/2;y++,dest+=mStride/2) { - memcpy(mYUVOverlay->pixels0+y*rect.w, Y+stride*y, rect.w); + memcpy(dest, V+chroma_stride*y, rect.w/2); } - for (int y=0;y<rect.h/2;y++) + for (int y=0;y<rect.h/2;y++,dest+=mStride/2) { - memcpy(mYUVOverlay->pixels2+y*rect.w/2, U+chroma_stride*y, rect.w/2); - memcpy(mYUVOverlay->pixels1+y*rect.w/2, V+chroma_stride*y, rect.w/2); + memcpy(dest, U+chroma_stride*y, rect.w/2); } } } @@ -156,48 +161,51 @@ void SDL_YUV_Display::display400(const unsigned char *Y, int stride) { - if (stride == rect.w) { + uint8_t *dest = mPixels; + if (stride == mStride) { // fast copy - memcpy(mYUVOverlay->pixels0, Y, rect.w * rect.h); + memcpy(mPixels, Y, rect.w * rect.h); + dest += mStride * rect.h; } else { // copy line by line, because sizes are different - for (int y=0;y<rect.h;y++) + for (int y=0;y<rect.h;y++,dest+=mStride) { - memcpy(mYUVOverlay->pixels0+y*rect.w, Y+stride*y, rect.w); + memcpy(dest, Y+stride*y, rect.w); } } // clear chroma planes - memset(mYUVOverlay->pixels1, 0x80, rect.w * rect.h / 4); - memset(mYUVOverlay->pixels2, 0x80, rect.w * rect.h / 4); + memset(dest, 0x80, mStride * rect.h / 2); } -void SDL_YUV_Display::display422(const unsigned char *Y, - const unsigned char *U, - const unsigned char *V, +void SDL_YUV_Display::display422(const unsigned char* Y, + const unsigned char* U, + const unsigned char* V, int stride, int chroma_stride) { - for (int y=0;y<rect.h;y++) - { - unsigned char* p = mYUVOverlay->pixels0 + y*rect.w *2; + for (int y = 0; y < rect.h; y++) { + unsigned char* dstY = mPixels + y * mStride; + const unsigned char* Yp = Y + y * stride; - const unsigned char* Yp = Y + y*stride; - const unsigned char* Up = U + y*chroma_stride; - const unsigned char* Vp = V + y*chroma_stride; + memcpy(dstY, Yp, rect.w); + } - for (int x=0;x<rect.w;x+=2) { - *p++ = Ypx; - *p++ = Upx/2;
View file
libde265-1.0.12.tar.gz/dec265/sdl.hh -> libde265-1.0.15.tar.gz/dec265/sdl.hh
Changed
@@ -48,10 +48,13 @@ bool isOpen() const { return mWindowOpen; } private: - SDL_Surface *mScreen; - SDL_Overlay *mYUVOverlay; + SDL_Window *mWindow = nullptr; + SDL_Renderer *mRenderer = nullptr; + SDL_Texture *mTexture = nullptr; SDL_Rect rect; bool mWindowOpen; + uint8_t *mPixels = nullptr; + int mStride = 0; SDL_Chroma mChroma;
View file
libde265-1.0.12.tar.gz/libde265.pc.in -> libde265-1.0.15.tar.gz/libde265.pc.in
Changed
@@ -7,7 +7,7 @@ Description: H.265/HEVC video decoder. URL: https://github.com/strukturag/libde265 Version: @VERSION@ -Requires: +Requires: Libs: -lde265 -L${libdir} -Libs.private: @LIBS@ -lstdc++ +Libs.private: @LIBS_PRIVATE@ Cflags: -I${includedir}
View file
libde265-1.0.12.tar.gz/libde265/CMakeLists.txt -> libde265-1.0.15.tar.gz/libde265/CMakeLists.txt
Changed
@@ -94,7 +94,15 @@ add_subdirectory (encoder) -if(NOT DISABLE_SSE) +check_c_source_compiles( + "#if !defined(__x86_64) && !defined(__i386__) \ + && !defined(_M_IX86) && !defined(_M_AMD64) + #error not x86 + #endif + int main(){return 0;}" + HAVE_X86) + +if(HAVE_X86) if (MSVC) set(SUPPORTS_SSE2 1) set(SUPPORTS_SSSE3 1)
View file
libde265-1.0.12.tar.gz/libde265/cabac.cc -> libde265-1.0.15.tar.gz/libde265/cabac.cc
Changed
@@ -492,6 +492,8 @@ vlc_buffer |= bits; vlc_buffer_len += n; + // TODO: errors returned by append_byte() are ignored, resulting in a broken output. + while (vlc_buffer_len>=8) { append_byte((vlc_buffer >> (vlc_buffer_len-8)) & 0xFF); vlc_buffer_len -= 8; @@ -524,6 +526,8 @@ void CABAC_encoder_bitstream::flush_VLC() { + // TODO: errors returned by append_byte() are ignored, resulting in a broken output. + while (vlc_buffer_len>=8) { append_byte((vlc_buffer >> (vlc_buffer_len-8)) & 0xFF); vlc_buffer_len -= 8; @@ -557,7 +561,7 @@ } -void CABAC_encoder_bitstream::check_size_and_resize(int nBytes) +bool CABAC_encoder_bitstream::check_size_and_resize(int nBytes) { if (data_size+nBytes > data_capacity) { // 1 extra byte for stuffing if (data_capacity==0) { @@ -566,14 +570,24 @@ data_capacity *= 2; } - data_mem = (uint8_t*)realloc(data_mem,data_capacity); + uint8_t* new_data_mem = (uint8_t*)realloc(data_mem,data_capacity); + if (new_data_mem) { + data_mem = new_data_mem; + } + else { + return false; + } } + + return true; } -void CABAC_encoder_bitstream::append_byte(int byte) +bool CABAC_encoder_bitstream::append_byte(int byte) { - check_size_and_resize(2); + if (!check_size_and_resize(2)) { + return false; + } // --- emulation prevention --- @@ -603,17 +617,23 @@ // write actual data byte data_mem data_size++ = byte; + + return true; } -void CABAC_encoder_bitstream::write_startcode() +bool CABAC_encoder_bitstream::write_startcode() { - check_size_and_resize(3); + if (!check_size_and_resize(3)) { + return false; + } data_mem data_size+0 = 0; data_mem data_size+1 = 0; data_mem data_size+2 = 1; data_size+=3; + + return true; } void CABAC_encoder_bitstream::init_CABAC() @@ -628,6 +648,8 @@ void CABAC_encoder_bitstream::flush_CABAC() { + // TODO: errors returned by append_byte() are ignored, resulting in a broken output. + if (low >> (32 - bits_left)) { append_byte(buffered_byte + 1); @@ -661,6 +683,8 @@ void CABAC_encoder_bitstream::write_out() { + // TODO: errors returned by append_byte() are ignored, resulting in a broken output. + //logtrace(LogCABAC,"low = %08x (bits_left=%d)\n",low,bits_left); int leadByte = low >> (24 - bits_left); bits_left += 8;
View file
libde265-1.0.12.tar.gz/libde265/cabac.h -> libde265-1.0.15.tar.gz/libde265/cabac.h
Changed
@@ -66,7 +66,7 @@ virtual void write_bit(int bit) { write_bits(bit,1); } virtual void write_uvlc(int value); virtual void write_svlc(int value); - virtual void write_startcode() = 0; + virtual bool write_startcode() = 0; virtual void skip_bits(int nBits) = 0; virtual void add_trailing_bits(); @@ -113,7 +113,7 @@ // --- VLC --- virtual void write_bits(uint32_t bits,int n); - virtual void write_startcode(); + virtual bool write_startcode(); virtual void skip_bits(int nBits); virtual int number_free_bits_in_byte() const; @@ -155,10 +155,10 @@ uint16_t num_buffered_bytes; - void check_size_and_resize(int nBytes); + bool check_size_and_resize(int nBytes); void testAndWriteOut(); void write_out(); - void append_byte(int byte); + bool append_byte(int byte); }; @@ -178,7 +178,7 @@ virtual void write_bits(uint32_t bits,int n) { mFracBits += n<<15; } virtual void write_bit(int bit) { mFracBits+=1<<15; } - virtual void write_startcode() { mFracBits += (1<<15)*8*3; } + virtual bool write_startcode() { mFracBits += (1<<15)*8*3; return true; } virtual void skip_bits(int nBits) { mFracBits += nBits<<15; } virtual int number_free_bits_in_byte() const { return 0; } // TODO, good enough for now
View file
libde265-1.0.12.tar.gz/libde265/configparam.cc -> libde265-1.0.15.tar.gz/libde265/configparam.cc
Changed
@@ -236,7 +236,7 @@ bool option_found=false; - for (int o=0;o<mOptions.size();o++) { + for (size_t o=0;o<mOptions.size();o++) { if (mOptionso->hasLongOption() && strcmp(mOptionso->getLongOption().c_str(), argvi+2)==0) { option_found=true; @@ -271,7 +271,7 @@ bool option_found=false; - for (int o=0;o<mOptions.size();o++) { + for (size_t o=0;o<mOptions.size();o++) { if (mOptionso->getShortOption() == option) { option_found=true; @@ -318,7 +318,7 @@ void config_parameters::print_params() const { - for (int i=0;i<mOptions.size();i++) { + for (size_t i=0;i<mOptions.size();i++) { const option_base* o = mOptionsi; std::stringstream sstr;
View file
libde265-1.0.12.tar.gz/libde265/de265-version.h -> libde265-1.0.15.tar.gz/libde265/de265-version.h
Changed
@@ -28,9 +28,9 @@ #define LIBDE265_VERSION_H /* Numeric representation of the version */ -#define LIBDE265_NUMERIC_VERSION 0x01001200 +#define LIBDE265_NUMERIC_VERSION 0x01001500 /* Version string */ -#define LIBDE265_VERSION "1.0.12" +#define LIBDE265_VERSION "1.0.15" #endif
View file
libde265-1.0.12.tar.gz/libde265/decctx.cc -> libde265-1.0.15.tar.gz/libde265/decctx.cc
Changed
@@ -186,11 +186,11 @@ image_unit::~image_unit() { - for (int i=0;i<slice_units.size();i++) { + for (size_t i=0;i<slice_units.size();i++) { delete slice_unitsi; } - for (int i=0;i<tasks.size();i++) { + for (size_t i=0;i<tasks.size();i++) { delete tasksi; } } @@ -582,16 +582,17 @@ std::shared_ptr<pic_parameter_set> new_pps = std::make_shared<pic_parameter_set>(); bool success = new_pps->read(&reader,this); + if (!success) { + return DE265_WARNING_PPS_HEADER_INVALID; + } if (param_pps_headers_fd>=0) { new_pps->dump(param_pps_headers_fd); } - if (success) { - pps (int)new_pps->pic_parameter_set_id = new_pps; - } + pps (int)new_pps->pic_parameter_set_id = new_pps; - return success ? DE265_OK : DE265_WARNING_PPS_HEADER_INVALID; + return DE265_OK; } de265_error decoder_context::read_sei_NAL(bitreader& reader, bool suffix) @@ -703,7 +704,7 @@ template <class T> void pop_front(std::vector<T>& vec) { - for (int i=1;i<vec.size();i++) + for (size_t i=1;i<vec.size();i++) veci-1 = veci; vec.pop_back(); @@ -780,7 +781,7 @@ // process suffix SEIs - for (int i=0;i<imgunit->suffix_SEIs.size();i++) { + for (size_t i=0;i<imgunit->suffix_SEIs.size();i++) { const sei_message& sei = imgunit->suffix_SEIsi; err = process_sei(&sei, imgunit->img); @@ -1093,7 +1094,7 @@ img->wait_for_completion(); - for (int i=0;i<imgunit->tasks.size();i++) + for (size_t i=0;i<imgunit->tasks.size();i++) delete imgunit->tasksi; imgunit->tasks.clear(); @@ -1183,7 +1184,7 @@ img->wait_for_completion(); - for (int i=0;i<imgunit->tasks.size();i++) + for (size_t i=0;i<imgunit->tasks.size();i++) delete imgunit->tasksi; imgunit->tasks.clear(); @@ -1474,7 +1475,7 @@ lower POCs seems to be compliant to the reference decoder. */ - for (int i=0;i<dpb.size();i++) { + for (size_t i=0;i<dpb.size();i++) { de265_image* img = dpb.get_image(i); if (img->PicState != UnusedForReference && @@ -2144,7 +2145,7 @@ void decoder_context::remove_images_from_dpb(const std::vector<int>& removeImageList) { - for (int i=0;i<removeImageList.size();i++) { + for (size_t i=0;i<removeImageList.size();i++) { int idx = dpb.DPB_index_of_picture_with_ID( removeImageListi ); if (idx>=0) { //printf("remove ID %d\n", removeImageListi);
View file
libde265-1.0.12.tar.gz/libde265/decctx.h -> libde265-1.0.15.tar.gz/libde265/decctx.h
Changed
@@ -203,7 +203,7 @@ std::vector<sei_message> suffix_SEIs; slice_unit* get_next_unprocessed_slice_segment() const { - for (int i=0;i<slice_units.size();i++) { + for (size_t i=0;i<slice_units.size();i++) { if (slice_unitsi->state == slice_unit::Unprocessed) { return slice_unitsi; } @@ -213,7 +213,7 @@ } slice_unit* get_prev_slice_segment(slice_unit* s) const { - for (int i=1; i<slice_units.size(); i++) { + for (size_t i=1; i<slice_units.size(); i++) { if (slice_unitsi==s) { return slice_unitsi-1; } @@ -223,7 +223,7 @@ } slice_unit* get_next_slice_segment(slice_unit* s) const { - for (int i=0; i<slice_units.size()-1; i++) { + for (size_t i=0; i<slice_units.size()-1; i++) { if (slice_unitsi==s) { return slice_unitsi+1; } @@ -233,8 +233,8 @@ } void dump_slices() const { - for (int i=0; i<slice_units.size(); i++) { - printf("%d = %p\n",i,slice_unitsi); + for (size_t i=0; i<slice_units.size(); i++) { + printf("%zu = %p\n",i,slice_unitsi); } }
View file
libde265-1.0.12.tar.gz/libde265/dpb.cc -> libde265-1.0.15.tar.gz/libde265/dpb.cc
Changed
@@ -36,14 +36,14 @@ decoded_picture_buffer::~decoded_picture_buffer() { - for (int i=0;i<dpb.size();i++) + for (size_t i=0;i<dpb.size();i++) delete dpbi; } void decoded_picture_buffer::log_dpb_content() const { - for (int i=0;i<dpb.size();i++) { + for (size_t i=0;i<dpb.size();i++) { loginfo(LogHighlevel, " DPB %d: POC=%d, ID=%d %s %s\n", i, dpbi->PicOrderCntVal, dpbi->get_ID(), @@ -63,7 +63,7 @@ if (dpb.size() < max_images_in_DPB) return true; // scan for empty slots - for (int i=0;i<dpb.size();i++) { + for (size_t i=0;i<dpb.size();i++) { if (dpbi->PicOutputFlag==false && dpbi->PicState == UnusedForReference) { return true; } @@ -81,7 +81,7 @@ //loginfo(LogDPB,"searching for short-term reference POC=%d\n",poc); if (preferLongTerm) { - for (int k=0;k<dpb.size();k++) { + for (size_t k=0;k<dpb.size();k++) { if (dpbk->PicOrderCntVal == poc && dpbk->removed_at_picture_id > currentID && dpbk->PicState == UsedForLongTermReference) { @@ -90,7 +90,7 @@ } } - for (int k=0;k<dpb.size();k++) { + for (size_t k=0;k<dpb.size();k++) { if (dpbk->PicOrderCntVal == poc && dpbk->removed_at_picture_id > currentID && dpbk->PicState != UnusedForReference) { @@ -107,7 +107,7 @@ logdebug(LogHeaders,"get access to picture with LSB %d from DPB\n",lsb); if (preferLongTerm) { - for (int k=0;k<dpb.size();k++) { + for (size_t k=0;k<dpb.size();k++) { if (dpbk->picture_order_cnt_lsb == lsb && dpbk->removed_at_picture_id > currentID && dpbk->PicState == UsedForLongTermReference) { @@ -116,7 +116,7 @@ } } - for (int k=0;k<dpb.size();k++) { + for (size_t k=0;k<dpb.size();k++) { if (dpbk->picture_order_cnt_lsb == lsb && dpbk->removed_at_picture_id > currentID && dpbk->PicState != UnusedForReference) { @@ -132,7 +132,7 @@ { logdebug(LogHeaders,"get access to picture with ID %d from DPB\n",id); - for (int k=0;k<dpb.size();k++) { + for (size_t k=0;k<dpb.size();k++) { if (dpbk->get_ID() == id) { return k; } @@ -150,7 +150,7 @@ int minPOC = reorder_output_queue0->PicOrderCntVal; int minIdx = 0; - for (int i=1;i<reorder_output_queue.size();i++) + for (size_t i=1;i<reorder_output_queue.size();i++) { if (reorder_output_queuei->PicOrderCntVal < minPOC) { minPOC = reorder_output_queuei->PicOrderCntVal; @@ -186,7 +186,7 @@ void decoded_picture_buffer::clear() { - for (int i=0;i<dpb.size();i++) { + for (size_t i=0;i<dpb.size();i++) { if (dpbi->PicOutputFlag || dpbi->PicState != UnusedForReference) { @@ -211,7 +211,7 @@ // --- search for a free slot in the DPB --- int free_image_buffer_idx = -DE265_ERROR_IMAGE_BUFFER_FULL; - for (int i=0;i<dpb.size();i++) { + for (size_t i=0;i<dpb.size();i++) { if (dpbi->can_be_released()) { dpbi->release(); /* TODO: this is surely not the best place to free the image, but we have to do it here because releasing it in de265_release_image()
View file
libde265-1.0.12.tar.gz/libde265/encoder/algo/coding-options.cc -> libde265-1.0.15.tar.gz/libde265/encoder/algo/coding-options.cc
Changed
@@ -110,7 +110,7 @@ template <class node> void CodingOptions<node>::compute_rdo_costs() { - for (int i=0;i<mOptions.size();i++) { + for (size_t i=0;i<mOptions.size();i++) { if (mOptionsi.computed) { //printf("compute_rdo_costs %d: %f\n",i, mOptionsi.mNode->rate); mOptionsi.rdoCost = mOptionsi.mNode->distortion + mECtx->lambda * mOptionsi.mNode->rate; @@ -129,7 +129,7 @@ bool first=true; int bestRDO=-1; - for (int i=0;i<mOptions.size();i++) { + for (size_t i=0;i<mOptions.size();i++) { if (mOptionsi.computed) { float cost = mOptionsi.rdoCost; @@ -159,7 +159,7 @@ // delete all CBs except the best one - for (int i=0;i<mOptions.size();i++) { + for (size_t i=0;i<mOptions.size();i++) { if (i != bestRDO) { delete mOptionsi.mNode;
View file
libde265-1.0.12.tar.gz/libde265/encoder/algo/tb-intrapredmode.cc -> libde265-1.0.15.tar.gz/libde265/encoder/algo/tb-intrapredmode.cc
Changed
@@ -464,7 +464,7 @@ CodingOptions<enc_tb> options(ectx, tb, ctxModel); std::vector<CodingOption<enc_tb> > option; - for (int i=0;i<distortions.size();i++) { + for (size_t i=0;i<distortions.size();i++) { enum IntraPredMode intraMode = (IntraPredMode)distortionsi.first; if (!isPredModeEnabled(intraMode)) { continue; }
View file
libde265-1.0.12.tar.gz/libde265/encoder/encoder-types.cc -> libde265-1.0.15.tar.gz/libde265/encoder/encoder-types.cc
Changed
@@ -638,7 +638,7 @@ void CTBTreeMatrix::writeReconstructionToImage(de265_image* img, const seq_parameter_set* sps) const { - for (int i=0;i<mCTBs.size();i++) { + for (size_t i=0;i<mCTBs.size();i++) { const enc_cb* cb = mCTBsi; cb->writeReconstructionToImage(img, sps); }
View file
libde265-1.0.12.tar.gz/libde265/encoder/encpicbuf.cc -> libde265-1.0.15.tar.gz/libde265/encoder/encpicbuf.cc
Changed
@@ -134,7 +134,7 @@ //shdr.num_ref_idx_l1_active = l1.size(); assert(l0.size() < MAX_NUM_REF_PICS); - for (int i=0;i<l0.size();i++) { + for (size_t i=0;i<l0.size();i++) { shdr.RefPicList0i = l0i; } @@ -245,7 +245,7 @@ bool encoder_picture_buffer::have_more_frames_to_encode() const { - for (int i=0;i<mImages.size();i++) { + for (size_t i=0;i<mImages.size();i++) { if (mImagesi->state < image_data::state_encoding) { return true; } @@ -257,7 +257,7 @@ image_data* encoder_picture_buffer::get_next_picture_to_encode() { - for (int i=0;i<mImages.size();i++) { + for (size_t i=0;i<mImages.size();i++) { if (mImagesi->state < image_data::state_encoding) { return mImagesi; } @@ -269,7 +269,7 @@ const image_data* encoder_picture_buffer::get_picture(int frame_number) const { - for (int i=0;i<mImages.size();i++) { + for (size_t i=0;i<mImages.size();i++) { if (mImagesi->frame_number == frame_number) return mImagesi; } @@ -281,7 +281,7 @@ image_data* encoder_picture_buffer::get_picture(int frame_number) { - for (int i=0;i<mImages.size();i++) { + for (size_t i=0;i<mImages.size();i++) { if (mImagesi->frame_number == frame_number) return mImagesi; } @@ -293,7 +293,7 @@ bool encoder_picture_buffer::has_picture(int frame_number) const { - for (int i=0;i<mImages.size();i++) { + for (size_t i=0;i<mImages.size();i++) { if (mImagesi->frame_number == frame_number) return true; }
View file
libde265-1.0.12.tar.gz/libde265/image.cc -> libde265-1.0.15.tar.gz/libde265/image.cc
Changed
@@ -330,6 +330,14 @@ int top = sps ? sps->conf_win_top_offset : 0; int bottom = sps ? sps->conf_win_bottom_offset : 0; + if ((left+right)*WinUnitX >= width) { + return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE; + } + + if ((top+bottom)*WinUnitY >= height) { + return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE; + } + width_confwin = width - (left+right)*WinUnitX; height_confwin= height- (top+bottom)*WinUnitY; chroma_width_confwin = chroma_width -left-right; @@ -511,7 +519,7 @@ // free slices - for (int i=0;i<slices.size();i++) { + for (size_t i=0;i<slices.size();i++) { delete slicesi; } slices.clear();
View file
libde265-1.0.12.tar.gz/libde265/image.h -> libde265-1.0.15.tar.gz/libde265/image.h
Changed
@@ -624,7 +624,14 @@ enum IntraPredMode get_IntraPredMode(int x,int y) const { - return (enum IntraPredMode)intraPredMode.get(x,y); + uint8_t ipm = intraPredMode.get(x,y); + + // sanitize values if IPM is uninitialized (because of earlier read error) + if (ipm > 34) { + ipm = 0; + } + + return static_cast<enum IntraPredMode>(ipm); } enum IntraPredMode get_IntraPredMode_atIndex(int idx) const
View file
libde265-1.0.12.tar.gz/libde265/motion.cc -> libde265-1.0.15.tar.gz/libde265/motion.cc
Changed
@@ -1716,9 +1716,24 @@ logmvcand(vi); const de265_image* imgX = NULL; - if (vi.predFlagX) imgX = ctx->get_image(shdr->RefPicListX vi.refIdxX ); + if (vi.predFlagX) { + // check for input data validity + if (vi.refIdxX<0 || vi.refIdxX >= MAX_NUM_REF_PICS) { + return; + } + + imgX = ctx->get_image(shdr->RefPicListX vi.refIdxX ); + } + const de265_image* imgY = NULL; - if (vi.predFlagY) imgY = ctx->get_image(shdr->RefPicListY vi.refIdxY ); + if (vi.predFlagY) { + // check for input data validity + if (vi.refIdxY<0 || vi.refIdxY >= MAX_NUM_REF_PICS) { + return; + } + + imgY = ctx->get_image(shdr->RefPicListY vi.refIdxY ); + } // check whether the predictor X is available and references the same POC if (vi.predFlagX && imgX && imgX->PicOrderCntVal == referenced_POC) { @@ -1849,9 +1864,22 @@ logmvcand(vi); const de265_image* imgX = NULL; - if (vi.predFlagX) imgX = ctx->get_image(shdr->RefPicListX vi.refIdxX ); + if (vi.predFlagX) { + if (vi.refIdxX < 0 || vi.refIdxX >= MAX_NUM_REF_PICS) { + return; + } + + imgX = ctx->get_image(shdr->RefPicListX vi.refIdxX ); + } + const de265_image* imgY = NULL; - if (vi.predFlagY) imgY = ctx->get_image(shdr->RefPicListY vi.refIdxY ); + if (vi.predFlagY) { + if (vi.refIdxY < 0 || vi.refIdxY >= MAX_NUM_REF_PICS) { + return; + } + + imgY = ctx->get_image(shdr->RefPicListY vi.refIdxY ); + } if (vi.predFlagX && imgX && imgX->PicOrderCntVal == referenced_POC) { logtrace(LogMotion,"a) take B%d/L%d as B candidate with same POC\n",k,X);
View file
libde265-1.0.12.tar.gz/libde265/nal-parser.cc -> libde265-1.0.15.tar.gz/libde265/nal-parser.cc
Changed
@@ -181,7 +181,7 @@ // free all NALs in free-list - for (int i=0;i<NAL_free_list.size();i++) { + for (size_t i=0;i<NAL_free_list.size();i++) { delete NAL_free_listi; } }
View file
libde265-1.0.12.tar.gz/libde265/refpic.cc -> libde265-1.0.15.tar.gz/libde265/refpic.cc
Changed
@@ -416,7 +416,7 @@ for (int i=set->NumNegativePics-1;i>=0;i--) { int n = set->DeltaPocS0i; - if (n>=-range) { + if (n>=-range && n<=range) { if (set->UsedByCurrPicS0i) logn+range = 'X'; else logn+range = 'o'; } else { log2fh(fh,"*%d%c ",n, set->UsedByCurrPicS0i ? 'X':'o'); } @@ -424,7 +424,7 @@ for (int i=set->NumPositivePics-1;i>=0;i--) { int n = set->DeltaPocS1i; - if (n<=range) { + if (n>=-range && n<=range) { if (set->UsedByCurrPicS1i) logn+range = 'X'; else logn+range = 'o'; } else { log2fh(fh,"*%d%c ",n, set->UsedByCurrPicS1i ? 'X':'o'); }
View file
libde265-1.0.12.tar.gz/libde265/slice.cc -> libde265-1.0.15.tar.gz/libde265/slice.cc
Changed
@@ -1277,14 +1277,23 @@ #define LOG3(t,d1,d2,d3) log2fh(fh, t,d1,d2,d3) #define LOG4(t,d1,d2,d3,d4) log2fh(fh, t,d1,d2,d3,d4) + LOG0("----------------- SLICE -----------------\n"); + const pic_parameter_set* pps = ctx->get_pps(slice_pic_parameter_set_id); + if (!pps) { + LOG0("invalid PPS referenced\n"); + return; + } assert(pps->pps_read); // TODO: error handling const seq_parameter_set* sps = ctx->get_sps((int)pps->seq_parameter_set_id); + if (!sps) { + LOG0("invalid SPS referenced\n"); + return; + } assert(sps->sps_read); // TODO: error handling - LOG0("----------------- SLICE -----------------\n"); LOG1("first_slice_segment_in_pic_flag : %d\n", first_slice_segment_in_pic_flag); if (ctx->get_nal_unit_type() >= NAL_UNIT_BLA_W_LP && ctx->get_nal_unit_type() <= NAL_UNIT_RESERVED_IRAP_VCL23) { @@ -2573,6 +2582,11 @@ static int decode_ref_idx_lX(thread_context* tctx, int numRefIdxLXActive) { + // prevent endless loop when 'numRefIdxLXActive' is invalid + if (numRefIdxLXActive <= 1) { + return 0; + } + logtrace(LogSlice,"# ref_idx_lX\n"); int cMax = numRefIdxLXActive-1;
View file
libde265-1.0.12.tar.gz/libde265/sps.cc -> libde265-1.0.15.tar.gz/libde265/sps.cc
Changed
@@ -722,7 +722,7 @@ LOG1("num_short_term_ref_pic_sets : %d\n", ref_pic_sets.size()); - for (int i = 0; i < ref_pic_sets.size(); i++) { + for (size_t i = 0; i < ref_pic_sets.size(); i++) { LOG1("ref_pic_set %2d : ",i); dump_compact_short_term_ref_pic_set(&ref_pic_setsi, 16, fh); }
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.