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 3
View file
libde265.changes
Changed
@@ -1,4 +1,15 @@ ------------------------------------------------------------------- +Tue May 8 20:49:06 UTC 2018 - zaitor@opensuse.org + +- Update to version 1.0.3: + + Fixes for compiler build problems. + + Security fixes, mainly checking for corrupted input streams. +- Add debian and upstream patches: + + libde265-only_export_decoder_api.patch + + libde265-disable_tools.patch + + libde265-use_new_FFMPEG_enum_names.patch + +------------------------------------------------------------------- Thu Nov 30 21:31:13 UTC 2017 - zaitor@opensuse.org - Add baselibs.conf, build 32bit support for x86_64.
View file
libde265.spec
Changed
@@ -15,7 +15,7 @@ %define so_ver 0 Name: libde265 -Version: 1.0.2 +Version: 1.0.3 Release: 0 Summary: Open H.265 video codec implementation License: LGPL-3.0 @@ -24,6 +24,10 @@ Source0: https://github.com/strukturag/libde265/releases/download/v%{version}/%{name}-%{version}.tar.gz Source99: baselibs.conf +Patch0: libde265-only_export_decoder_api.patch +Patch1: libde265-disable_tools.patch +Patch2: libde265-use_new_FFMPEG_enum_names.patch + BuildRequires: autoconf BuildRequires: automake BuildRequires: gcc-c++ @@ -60,7 +64,7 @@ are provided by this package. %prep -%autosetup +%autosetup -p1 %build NOCONFIGURE=1 ./autogen.sh @@ -76,15 +80,6 @@ %make_install find %{buildroot} -type f -name "*.la" -delete -print -# Don't package internal development tools. -rm %{buildroot}%{_bindir}/bjoentegaard -rm %{buildroot}%{_bindir}/block-rate-estim -rm %{buildroot}%{_bindir}/enc265 -rm %{buildroot}%{_bindir}/gen-enc-table -rm %{buildroot}%{_bindir}/rd-curves -rm %{buildroot}%{_bindir}/tests -rm %{buildroot}%{_bindir}/yuv-distortion - %post -n %{name}-%{so_ver} -p /sbin/ldconfig %postun -n %{name}-%{so_ver} -p /sbin/ldconfig @@ -99,4 +94,3 @@ %{_libdir}/pkgconfig/%{name}.pc %changelog -
View file
libde265-disable_tools.patch
Added
@@ -0,0 +1,38 @@ +Description: Disable building of some internal tools that no longer link + because internal symbols are not exported. +Author: Joachim Bauch <bauch@struktur.de> +--- a/Makefile.am ++++ b/Makefile.am +@@ -8,10 +8,6 @@ + SUBDIRS+=dec265 + endif + +-SUBDIRS+=enc265 +-SUBDIRS+=tools +-SUBDIRS+=acceleration-speed +- + if ENABLE_SHERLOCK265 + SUBDIRS+=sherlock265 + endif +--- a/dec265/Makefile.am ++++ b/dec265/Makefile.am +@@ -1,5 +1,5 @@ + +-bin_PROGRAMS = dec265 hdrcopy ++bin_PROGRAMS = dec265 + + AM_CPPFLAGS = -I../libde265 + +@@ -9,12 +9,6 @@ + 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 +- + if HAVE_VIDEOGFX + dec265_CXXFLAGS += $(VIDEOGFX_CFLAGS) + dec265_LDFLAGS += $(VIDEOGFX_LIBS)
View file
libde265-only_export_decoder_api.patch
Added
@@ -0,0 +1,286 @@ +Description: Only export symbols defined in the decoder API. + The encoder API is not final yet, so upstream exports all symbols to make + development easier. For packaging we only want to expose the public API. +Author: Joachim Bauch <bauch@struktur.de> +--- a/libde265/encoder/Makefile.am ++++ b/libde265/encoder/Makefile.am +@@ -10,6 +10,18 @@ + encpicbuf.h encpicbuf.cc \ + sop.h sop.cc + ++libde265_encoder_la_CFLAGS = \ ++ $(CFLAG_VISIBILITY) \ ++ -DLIBDE265_EXPORTS ++libde265_encoder_la_CXXFLAGS += \ ++ $(CFLAG_VISIBILITY) \ ++ -DLIBDE265_EXPORTS ++ ++if HAVE_VISIBILITY ++ libde265_encoder_la_CFLAGS += -DHAVE_VISIBILITY ++ libde265_encoder_la_CXXFLAGS += -DHAVE_VISIBILITY ++endif ++ + SUBDIRS=algo + libde265_encoder_la_LIBADD = algo/libde265_encoder_algo.la + +--- a/libde265/encoder/algo/Makefile.am ++++ b/libde265/encoder/algo/Makefile.am +@@ -17,5 +17,13 @@ + tb-rateestim.h tb-rateestim.cc \ + pb-mv.h pb-mv.cc + ++libde265_encoder_algo_la_CXXFLAGS += \ ++ $(CFLAG_VISIBILITY) \ ++ -DLIBDE265_EXPORTS ++ ++if HAVE_VISIBILITY ++ libde265_encoder_algo_la_CXXFLAGS += -DHAVE_VISIBILITY ++endif ++ + EXTRA_DIST = \ + CMakeLists.txt +--- a/configure.ac ++++ b/configure.ac +@@ -50,9 +50,7 @@ + fi + changequote([,])dnl + +-dnl gl_VISIBILITY +-dnl : In encoder branch, we still export all library symbols : +-HAVE_VISIBILITY=0 ++gl_VISIBILITY + AM_CONDITIONAL([HAVE_VISIBILITY], [test "x$HAVE_VISIBILITY" != "x0"]) + + # Checks for header files. +--- a/libde265/image-io.cc ++++ b/libde265/image-io.cc +@@ -183,7 +183,7 @@ + } + + +-LIBDE265_API PacketSink_File::~PacketSink_File() ++PacketSink_File::~PacketSink_File() + { + if (mFH) { + fclose(mFH); +@@ -191,7 +191,7 @@ + } + + +-LIBDE265_API void PacketSink_File::set_filename(const char* filename) ++void PacketSink_File::set_filename(const char* filename) + { + assert(mFH==NULL); + +@@ -199,7 +199,7 @@ + } + + +-LIBDE265_API void PacketSink_File::send_packet(const uint8_t* data, int n) ++void PacketSink_File::send_packet(const uint8_t* data, int n) + { + uint8_t startCode[3]; + startCode[0] = 0; +--- a/libde265/image-io.h ++++ b/libde265/image-io.h +@@ -30,17 +30,17 @@ + class ImageSource + { + public: +- LIBDE265_API ImageSource(); +- virtual LIBDE265_API ~ImageSource() { } ++ ImageSource(); ++ virtual ~ImageSource() { } + + //enum ImageStatus { Available, Waiting, EndOfVideo }; + + //virtual ImageStatus get_status() = 0; +- virtual LIBDE265_API de265_image* get_image(bool block=true) = 0; +- virtual LIBDE265_API void skip_frames(int n) = 0; ++ virtual de265_image* get_image(bool block=true) = 0; ++ virtual void skip_frames(int n) = 0; + +- virtual LIBDE265_API int get_width() const = 0; +- virtual LIBDE265_API int get_height() const = 0; ++ virtual int get_width() const = 0; ++ virtual int get_height() const = 0; + }; + + +@@ -48,17 +48,17 @@ + class ImageSource_YUV : public ImageSource + { + public: +- LIBDE265_API ImageSource_YUV(); +- virtual LIBDE265_API ~ImageSource_YUV(); ++ ImageSource_YUV(); ++ virtual ~ImageSource_YUV(); + +- bool LIBDE265_API set_input_file(const char* filename, int w,int h); ++ bool set_input_file(const char* filename, int w,int h); + + //virtual ImageStatus get_status(); +- virtual LIBDE265_API de265_image* get_image(bool block=true); +- virtual LIBDE265_API void skip_frames(int n); ++ virtual de265_image* get_image(bool block=true); ++ virtual void skip_frames(int n); + +- virtual LIBDE265_API int get_width() const { return width; } +- virtual LIBDE265_API int get_height() const { return height; } ++ virtual int get_width() const { return width; } ++ virtual int get_height() const { return height; } + + private: + FILE* mFH; +@@ -74,20 +74,20 @@ + class ImageSink + { + public: +- virtual LIBDE265_API ~ImageSink() { } ++ virtual ~ImageSink() { } + +- virtual LIBDE265_API void send_image(const de265_image* img) = 0; ++ virtual void send_image(const de265_image* img) = 0; + }; + + class ImageSink_YUV : public ImageSink + { + public: +- LIBDE265_API ImageSink_YUV() : mFH(NULL) { } +- LIBDE265_API ~ImageSink_YUV(); ++ ImageSink_YUV() : mFH(NULL) { } ++ ~ImageSink_YUV(); + +- bool LIBDE265_API set_filename(const char* filename); ++ bool set_filename(const char* filename); + +- virtual LIBDE265_API void send_image(const de265_image* img); ++ virtual void send_image(const de265_image* img); + + private: + FILE* mFH; +@@ -98,21 +98,21 @@ + class PacketSink + { + public: +- virtual LIBDE265_API ~PacketSink() { } ++ virtual ~PacketSink() { } + +- virtual LIBDE265_API void send_packet(const uint8_t* data, int n) = 0; ++ virtual void send_packet(const uint8_t* data, int n) = 0; + }; + + + class PacketSink_File : public PacketSink + { + public: +- LIBDE265_API PacketSink_File(); +- virtual LIBDE265_API ~PacketSink_File(); ++ PacketSink_File(); ++ virtual ~PacketSink_File(); + +- LIBDE265_API void set_filename(const char* filename); ++ void set_filename(const char* filename); + +- virtual LIBDE265_API void send_packet(const uint8_t* data, int n); ++ virtual void send_packet(const uint8_t* data, int n); + + private: + FILE* mFH; +--- a/libde265/configparam.h ++++ b/libde265/configparam.h +@@ -95,7 +95,7 @@ + bool hasLongOption() const { return true; } //mLongOption!=NULL; } + std::string getLongOption() const { return mLongOption ? std::string(mLongOption) : get_name(); } + +- virtual LIBDE265_API bool processCmdLineArguments(char** argv, int* argc, int idx) { return false; } ++ virtual bool processCmdLineArguments(char** argv, int* argc, int idx) { return false; } + +
View file
libde265-use_new_FFMPEG_enum_names.patch
Added
@@ -0,0 +1,23 @@ +From e5b8e2e703d608777afadc54955bd396e4211da0 Mon Sep 17 00:00:00 2001 +From: Dirk Farin <farin@struktur.de> +Date: Thu, 19 Apr 2018 13:15:18 +0200 +Subject: [PATCH] use new FFMPEG enum names + +--- + sherlock265/VideoDecoder.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sherlock265/VideoDecoder.cc b/sherlock265/VideoDecoder.cc +index 119f6152..b829e1c7 100644 +--- a/sherlock265/VideoDecoder.cc ++++ b/sherlock265/VideoDecoder.cc +@@ -237,7 +237,7 @@ void VideoDecoder::convert_frame_swscale(const de265_image* img, QImage & qimg) + } + width = img->get_width(); + height = img->get_height(); +- sws = sws_getContext(width, height, PIX_FMT_YUV420P, width, height, PIX_FMT_BGRA, SWS_FAST_BILINEAR, NULL, NULL, NULL); ++ sws = sws_getContext(width, height, AV_PIX_FMT_YUV420P, width, height, AV_PIX_FMT_BGRA, SWS_FAST_BILINEAR, NULL, NULL, NULL); + } + + int stride[3]; +
View file
libde265-1.0.2.tar.gz/TODO
Deleted
@@ -1,13 +0,0 @@ -/mnt/temp/dirk/yuv/flower_garden_422_720x486_30fps_simple_intra.bin - -diff at byte 00196800 -frame 3 -channel: 0 -pixel position: x=384;y=125 -file A: 56 -file B: 86 - - -- API: request IDR-frame -- API: return SPS header infos -- rate-control: specify bit-rate
View file
libde265-1.0.2.tar.gz/libde265/encoder/analyze.cc
Deleted
@@ -1,371 +0,0 @@ -/* - * H.265 video codec. - * Copyright (c) 2013-2014 struktur AG, Dirk Farin <farin@struktur.de> - * - * Authors: struktur AG, Dirk Farin <farin@struktur.de> - * - * This file is part of libde265. - * - * libde265 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * libde265 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with libde265. If not, see <http://www.gnu.org/licenses/>. - */ - - -#include "libde265/encoder/analyze.h" -#include "libde265/encoder/encoder-context.h" -#include <assert.h> -#include <limits> -#include <math.h> -#include <iostream> - - -#define ENCODER_DEVELOPMENT 0 -#define COMPARE_ESTIMATED_RATE_TO_REAL_RATE 0 - - -static int IntraPredModeCnt[7][35]; -static int MPM_used[7][35]; - -static int IntraPredModeCnt_total[35]; -static int MPM_used_total[35]; - -void statistics_IntraPredMode(const encoder_context* ectx, int x,int y, const enc_cb* cb) -{ - if (cb->split_cu_flag) { - for (int i=0;i<4;i++) - if (cb->children[i]) { - statistics_IntraPredMode(ectx, childX(x,i,cb->log2Size), childY(y,i,cb->log2Size), cb->children[i]); - } - } - else { - int cnt; - int size = cb->log2Size; - - if (cb->PartMode == PART_NxN) { cnt=4; size--; } else cnt=1; - - for (int i=0;i<cnt;i++) { - IntraPredModeCnt[size][ cb->intra.pred_mode[i] ]++; - IntraPredModeCnt_total[ cb->intra.pred_mode[i] ]++; - - int xi = childX(x,i,cb->log2Size); - int yi = childY(y,i,cb->log2Size); - - int candModeList[3]; - fillIntraPredModeCandidates(candModeList,xi,yi, xi>0, yi>0, ectx->img); - - int predmode = cb->intra.pred_mode[i]; - if (candModeList[0]==predmode || - candModeList[1]==predmode || - candModeList[2]==predmode) { - MPM_used[size][predmode]++; - MPM_used_total[predmode]++; - } - } - } -} - -void statistics_print() -{ - for (int i=0;i<35;i++) { - printf("%d",i); - printf(" %d %d",IntraPredModeCnt_total[i], MPM_used_total[i]); - - for (int k=2;k<=6;k++) { - printf(" %d %d",IntraPredModeCnt[k][i], MPM_used[k][i]); - } - - printf("\n"); - } -} - - -void print_tb_tree_rates(const enc_tb* tb, int level) -{ - for (int i=0;i<level;i++) - std::cout << " "; - - std::cout << "TB rate=" << tb->rate << " (" << tb->rate_withoutCbfChroma << ")\n"; - if (tb->split_transform_flag) { - for (int i=0;i<4;i++) - print_tb_tree_rates(tb->children[i], level+1); - } -} - - -void print_cb_tree_rates(const enc_cb* cb, int level) -{ - for (int i=0;i<level;i++) - std::cout << " "; - - std::cout << "CB rate=" << cb->rate << "\n"; - if (cb->split_cu_flag) { - for (int i=0;i<4;i++) - print_cb_tree_rates(cb->children[i], level+1); - } - else { - print_tb_tree_rates(cb->transform_tree, level+1); - } -} - - -double encode_image(encoder_context* ectx, - const de265_image* input, - EncodingAlgorithm& algo) -{ - int stride=input->get_image_stride(0); - - int w = ectx->sps.pic_width_in_luma_samples; - int h = ectx->sps.pic_height_in_luma_samples; - - // --- create reconstruction image --- - ectx->img = new de265_image; - ectx->img->vps = ectx->vps; - ectx->img->sps = ectx->sps; - ectx->img->pps = ectx->pps; - ectx->img->PicOrderCntVal = input->PicOrderCntVal; - - ectx->img->alloc_image(w,h, de265_chroma_420, &ectx->sps, true, - NULL /* no decctx */, ectx, 0,NULL,false); - //ectx->img->alloc_encoder_data(&ectx->sps); - ectx->img->clear_metadata(); - -#if 1 - if (1) { - ectx->prediction = new de265_image; - ectx->prediction->alloc_image(w,h, de265_chroma_420, &ectx->sps, false /* no metadata */, - NULL /* no decctx */, NULL /* no encctx */, 0,NULL,false); - ectx->prediction->vps = ectx->vps; - ectx->prediction->sps = ectx->sps; - ectx->prediction->pps = ectx->pps; - } -#endif - - ectx->active_qp = ectx->pps.pic_init_qp; // TODO take current qp from slice - - - ectx->cabac_ctx_models.init(ectx->shdr->initType, ectx->shdr->SliceQPY); - ectx->cabac_encoder.set_context_models(&ectx->cabac_ctx_models); - - - context_model_table modelEstim; - CABAC_encoder_estim cabacEstim; - - modelEstim.init(ectx->shdr->initType, ectx->shdr->SliceQPY); - cabacEstim.set_context_models(&modelEstim); - - - int Log2CtbSize = ectx->sps.Log2CtbSizeY; - - uint8_t* luma_plane = ectx->img->get_image_plane(0); - uint8_t* cb_plane = ectx->img->get_image_plane(1); - uint8_t* cr_plane = ectx->img->get_image_plane(2); - - - // encode CTB by CTB - - for (int y=0;y<ectx->sps.PicHeightInCtbsY;y++) - for (int x=0;x<ectx->sps.PicWidthInCtbsY;x++) - { - ectx->img->set_SliceAddrRS(x, y, ectx->shdr->SliceAddrRS); - - int x0 = x<<Log2CtbSize; - int y0 = y<<Log2CtbSize; - - logtrace(LogSlice,"encode CTB at %d %d\n",x0,y0); - - // make a copy of the context model that we can modify for testing alternatives - - context_model_table ctxModel; - //copy_context_model_table(ctxModel, ectx->ctx_model_bitstream); - ctxModel = ectx->cabac_ctx_models.copy(); - ctxModel = modelEstim.copy(); // TODO TMP - - disable_logging(LogSymbols); - enable_logging(LogSymbols); // TODO TMP - - //printf("================================================== ANALYZE\n"); - -#if 1 - /*
View file
libde265-1.0.2.tar.gz/libde265/encoder/analyze.h
Deleted
@@ -1,146 +0,0 @@ -/* - * H.265 video codec. - * Copyright (c) 2013-2014 struktur AG, Dirk Farin <farin@struktur.de> - * - * Authors: Dirk Farin <farin@struktur.de> - * - * This file is part of libde265. - * - * libde265 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * libde265 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with libde265. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef ANALYZE_H -#define ANALYZE_H - -#include "libde265/nal-parser.h" -#include "libde265/decctx.h" -#include "libde265/encoder/encode.h" -#include "libde265/slice.h" -#include "libde265/scan.h" -#include "libde265/intrapred.h" -#include "libde265/transform.h" -#include "libde265/fallback-dct.h" -#include "libde265/quality.h" -#include "libde265/fallback.h" -#include "libde265/configparam.h" - -#include "libde265/encoder/algo/tb-intrapredmode.h" -#include "libde265/encoder/algo/tb-split.h" -#include "libde265/encoder/algo/cb-intrapartmode.h" -#include "libde265/encoder/algo/cb-interpartmode.h" -#include "libde265/encoder/algo/cb-split.h" -#include "libde265/encoder/algo/ctb-qscale.h" -#include "libde265/encoder/algo/cb-mergeindex.h" -//#include "libde265/encoder/algo/cb-skip-or-inter.h" -#include "libde265/encoder/algo/pb-mv.h" -#include "libde265/encoder/algo/cb-skip.h" -#include "libde265/encoder/algo/cb-intra-inter.h" - - -/* Encoder search tree, bottom up: - - - Algo_TB_Split - whether TB is split or not - - - Algo_TB_IntraPredMode - choose the intra prediction mode (or NOP, if at the wrong tree level) - - - Algo_CB_IntraPartMode - choose between NxN and 2Nx2N intra parts - - - Algo_CB_PredMode - intra / inter - - - Algo_CB_Split - whether CB is split or not - - - Algo_CTB_QScale - select QScale on CTB granularity - */ - - -// ========== an encoding algorithm combines a set of algorithm modules ========== - -class EncodingAlgorithm -{ - public: - virtual ~EncodingAlgorithm() { } - - virtual Algo_CTB_QScale* getAlgoCTBQScale() = 0; - - virtual int getPPS_QP() const = 0; - virtual int getSlice_QPDelta() const { return 0; } -}; - - -class EncodingAlgorithm_Custom : public EncodingAlgorithm -{ - public: - - void setParams(struct encoder_params& params); - - void registerParams(config_parameters& config) { - mAlgo_CTB_QScale_Constant.registerParams(config); - mAlgo_CB_IntraPartMode_Fixed.registerParams(config); - mAlgo_CB_InterPartMode_Fixed.registerParams(config); - mAlgo_PB_MV_Test.registerParams(config); - mAlgo_PB_MV_Search.registerParams(config); - mAlgo_TB_IntraPredMode_FastBrute.registerParams(config); - mAlgo_TB_IntraPredMode_MinResidual.registerParams(config); - mAlgo_TB_Split_BruteForce.registerParams(config); - } - - virtual Algo_CTB_QScale* getAlgoCTBQScale() { return &mAlgo_CTB_QScale_Constant; } - - virtual int getPPS_QP() const { return mAlgo_CTB_QScale_Constant.getQP(); } - - private: - Algo_CTB_QScale_Constant mAlgo_CTB_QScale_Constant; - - Algo_CB_Split_BruteForce mAlgo_CB_Split_BruteForce; - Algo_CB_Skip_BruteForce mAlgo_CB_Skip_BruteForce; - Algo_CB_IntraInter_BruteForce mAlgo_CB_IntraInter_BruteForce; - - Algo_CB_IntraPartMode_BruteForce mAlgo_CB_IntraPartMode_BruteForce; - Algo_CB_IntraPartMode_Fixed mAlgo_CB_IntraPartMode_Fixed; - - Algo_CB_InterPartMode_Fixed mAlgo_CB_InterPartMode_Fixed; - Algo_CB_MergeIndex_Fixed mAlgo_CB_MergeIndex_Fixed; - - Algo_PB_MV_Test mAlgo_PB_MV_Test; - Algo_PB_MV_Search mAlgo_PB_MV_Search; - - Algo_TB_Split_BruteForce mAlgo_TB_Split_BruteForce; - - Algo_TB_IntraPredMode_BruteForce mAlgo_TB_IntraPredMode_BruteForce; - Algo_TB_IntraPredMode_FastBrute mAlgo_TB_IntraPredMode_FastBrute; - Algo_TB_IntraPredMode_MinResidual mAlgo_TB_IntraPredMode_MinResidual; -}; - - - -double encode_image(encoder_context*, const de265_image* input, EncodingAlgorithm&); - -void encode_sequence(encoder_context*); - - -class Logging -{ -public: - virtual ~Logging() { } - - static void print_logging(const encoder_context* ectx, const char* id, const char* filename); - - virtual const char* name() const = 0; - virtual void print(const encoder_context* ectx, const char* filename) = 0; -}; - - -LIBDE265_API void en265_print_logging(const encoder_context* ectx, const char* id, const char* filename); - -#endif
View file
libde265-1.0.2.tar.gz/libde265/encoder/encode.cc
Deleted
@@ -1,1981 +0,0 @@ -/* - * H.265 video codec. - * Copyright (c) 2013-2014 struktur AG, Dirk Farin <farin@struktur.de> - * - * Authors: struktur AG, Dirk Farin <farin@struktur.de> - * - * This file is part of libde265. - * - * libde265 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * libde265 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with libde265. If not, see <http://www.gnu.org/licenses/>. - */ - -#include "encode.h" -#include "encoder-context.h" -#include "slice.h" -#include "scan.h" -#include "intrapred.h" -#include "libde265/transform.h" -#include "libde265/fallback-dct.h" -#include <iostream> - - -int allocTB = 0; -int allocCB = 0; - -#define DEBUG_ALLOCS 0 - - - -void enc_node::save(const de265_image* img) -{ - delete[] mReconstruction; - - int blkSize = Log2SizeToArea(log2Size); - mReconstruction = new uint8_t[blkSize * 3/2]; - - int w = 1<<log2Size; - - copy_subimage(mReconstruction, w, - img->get_image_plane_at_pos(0, x,y), - img->get_image_stride(0), - w,w); - - copy_subimage(mReconstruction + blkSize, w>>1, - img->get_image_plane_at_pos(1, x>>1,y>>1), - img->get_image_stride(1), - w>>1,w>>1); - - copy_subimage(mReconstruction + blkSize*5/4, w>>1, - img->get_image_plane_at_pos(2, x>>1,y>>1), - img->get_image_stride(2), - w>>1,w>>1); -} - - -void enc_node::restore(de265_image* img) -{ - assert(mReconstruction); - - int blkSize = Log2SizeToArea(log2Size); - int w = 1<<log2Size; - - copy_subimage(img->get_image_plane_at_pos(0, x,y), - img->get_image_stride(0), - mReconstruction, w, - w,w); - - copy_subimage(img->get_image_plane_at_pos(1, x>>1,y>>1), - img->get_image_stride(1), - mReconstruction + blkSize, w>>1, - w>>1,w>>1); - - copy_subimage(img->get_image_plane_at_pos(2, x>>1,y>>1), - img->get_image_stride(2), - mReconstruction + blkSize*5/4, w>>1, - w>>1,w>>1); -} - - -void enc_cb::save(const de265_image* img) -{ - enc_node::save(img); - - // TODO: save metadata in node buffer memory -} - - -void enc_cb::restore(de265_image* img) -{ - enc_node::restore(img); - - // write back all the metadata - - write_to_image(img); -} - - -void enc_cb::set_rqt_root_bf_from_children_cbf() -{ - assert(transform_tree); - inter.rqt_root_cbf = (transform_tree->cbf[0] | - transform_tree->cbf[1] | - transform_tree->cbf[2]); -} - - - - -alloc_pool enc_tb::mMemPool(sizeof(enc_tb)); - -enc_tb::enc_tb() - : split_transform_flag(false) -{ - coeff[0]=coeff[1]=coeff[2]=NULL; - - if (DEBUG_ALLOCS) { allocTB++; printf("TB : %d\n",allocTB); } -} - - -enc_tb::~enc_tb() -{ - if (split_transform_flag) { - for (int i=0;i<4;i++) { - delete children[i]; - } - } - else { - for (int i=0;i<3;i++) { - delete[] coeff[i]; - } - } - - if (DEBUG_ALLOCS) { allocTB--; printf("TB ~: %d\n",allocTB); } -} - - -void enc_tb::alloc_coeff_memory(int cIdx, int tbSize) -{ - assert(coeff[cIdx]==NULL); - coeff[cIdx] = new int16_t[tbSize*tbSize]; -} - - -void enc_tb::reconstruct_tb(encoder_context* ectx, - de265_image* img, - int x0,int y0, // luma - int log2TbSize, // chroma adapted - const enc_cb* cb, int cIdx) const -{ - // chroma adapted position - int xC=x0; - int yC=y0; - - if (cIdx>0) { - xC>>=1; - yC>>=1; - } - - if (cb->PredMode == MODE_INTRA) { - - enum IntraPredMode intraPredMode = img->get_IntraPredMode(x0,y0); - - if (cIdx>0) { - intraPredMode = cb->intra.chroma_mode; - //intraPredMode = lumaPredMode_to_chromaPredMode(intraPredMode, cb->intra.chroma_mode); - } - - decode_intra_prediction(img, xC,yC, intraPredMode, 1<< log2TbSize , cIdx); - } - else { - int size = 1<<log2TbSize; - - uint8_t* dst_ptr = img->get_image_plane_at_pos(cIdx, xC, yC ); - int dst_stride = img->get_image_stride(cIdx); - - uint8_t* src_ptr = ectx->prediction->get_image_plane_at_pos(cIdx, xC, yC ); - int src_stride = ectx->prediction->get_image_stride(cIdx); - - for (int y=0;y<size;y++) { - for (int x=0;x<size;x++) { - dst_ptr[y*dst_stride+x] = src_ptr[y*src_stride+x]; - } - } - } - - ALIGNED_16(int16_t) dequant_coeff[32*32]; - - if (cbf[cIdx]) dequant_coefficients(dequant_coeff, coeff[cIdx], log2TbSize, cb->qp); -
View file
libde265-1.0.2.tar.gz/libde265/encoder/encode.h
Deleted
@@ -1,289 +0,0 @@ -/* - * H.265 video codec. - * Copyright (c) 2013-2014 struktur AG, Dirk Farin <farin@struktur.de> - * - * Authors: Dirk Farin <farin@struktur.de> - * - * This file is part of libde265. - * - * libde265 is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * libde265 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with libde265. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef ENCODE_H -#define ENCODE_H - -#include "libde265/image.h" -#include "libde265/decctx.h" -#include "libde265/image-io.h" -#include "libde265/alloc_pool.h" - -class encoder_context; -class enc_cb; - - -class enc_node -{ - public: - enc_node() { mReconstruction=NULL; } - virtual ~enc_node() { delete[] mReconstruction; } - - uint16_t x,y; - uint8_t log2Size : 3; - - virtual void save(const de265_image*); - virtual void restore(de265_image*); - - private: - uint8_t* mReconstruction; -}; - - -class enc_tb : public enc_node -{ - public: - enc_tb(); - ~enc_tb(); - - const enc_tb* parent; - - uint8_t split_transform_flag : 1; - uint8_t TrafoDepth : 2; // 2 bits enough ? (TODO) - - uint8_t cbf[3]; - - union { - // split - struct { - enc_tb* children[4]; - }; - - // non-split - struct { - int16_t* coeff[3]; - }; - }; - - float distortion; // total distortion for this level of the TB tree (including all children) - float rate; // total rate for coding this TB level and all children - float rate_withoutCbfChroma; - - void set_cbf_flags_from_children(); - - void reconstruct(encoder_context* ectx, - de265_image* img, - const enc_cb* cb, int blkIdx=0) const; - - bool isZeroBlock() const { return cbf[0]==false && cbf[1]==false && cbf[2]==false; } - - void alloc_coeff_memory(int cIdx, int tbSize); - - static void* operator new(const size_t size) { return mMemPool.new_obj(size); } - static void operator delete(void* obj) { mMemPool.delete_obj(obj); } - -private: - static alloc_pool mMemPool; - - void reconstruct_tb(encoder_context* ectx, - de265_image* img, int x0,int y0, int log2TbSize, - const enc_cb* cb, int cIdx) const; -}; - - -struct enc_pb_inter -{ - /* absolute motion information (for MV-prediction candidates) - */ - MotionVectorSpec motion; - - /* specification how to code the motion vector in the bitstream - */ - motion_spec spec; - - - // NOT TRUE: refIdx in 'spec' is not used. It is taken from 'motion' - // Currently, information is duplicated. Same as with inter_pred_idc/predFlag[]. - - /* SPEC: - int8_t refIdx[2]; // not used - int16_t mvd[2][2]; - - uint8_t inter_pred_idc : 2; // enum InterPredIdc - uint8_t mvp_l0_flag : 1; - uint8_t mvp_l1_flag : 1; - uint8_t merge_flag : 1; - uint8_t merge_idx : 3; - */ -}; - - -class enc_cb : public enc_node -{ -public: - enc_cb(); - ~enc_cb(); - - const enc_cb* parent; - - uint8_t split_cu_flag : 1; - uint8_t ctDepth : 2; - - union { - // split - struct { - enc_cb* children[4]; // undefined when split_cu_flag==false - }; - - // non-split - struct { - uint8_t qp : 6; - uint8_t cu_transquant_bypass_flag : 1; // currently unused - uint8_t pcm_flag : 1; - - enum PredMode PredMode; // : 6; - enum PartMode PartMode; // : 3; - - union { - struct { - enum IntraPredMode pred_mode[4]; - enum IntraPredMode chroma_mode; - } intra; - - struct { - enc_pb_inter pb[4]; - - uint8_t rqt_root_cbf : 1; - } inter; - }; - - const enc_tb* transform_tree; - }; - }; - - - float distortion; - float rate; - - - void set_rqt_root_bf_from_children_cbf(); - - /* Save CB reconstruction in the node and restore it again to the image. - Pixel data and metadata. - */ - virtual void save(const de265_image*); - virtual void restore(de265_image*); - - - /* Decode this CB: pixel data and write metadata to image. - */ - void reconstruct(encoder_context* ectx,de265_image* img) const; - - - // memory management - - static void* operator new(const size_t size) { return mMemPool.new_obj(size); } - static void operator delete(void* obj) { mMemPool.delete_obj(obj); } - - private: - void write_to_image(de265_image*) const; -
View file
libde265-1.0.2.tar.gz/.travis.yml -> libde265-1.0.3.tar.gz/.travis.yml
Changed
@@ -5,6 +5,10 @@ - gcc env: - HOST= WINE= DECODESTREAMS= + - HOST=i686-w64-mingw32 WINE=wine DECODESTREAMS= + - HOST=x86_64-w64-mingw32 WINE=wine64 DECODESTREAMS= + - HOST=arm-linux-gnueabihf WINE= DECODESTREAMS= + - HOST=cmake WINE= DECODESTREAMS= - HOST= WINE= DECODESTREAMS=libde265-teststreams-fuzzing THREADING= - HOST= WINE= DECODESTREAMS=libde265-teststreams-fuzzing THREADING=--single-threaded - HOST= WINE= DECODESTREAMS=libde265-teststreams-nolf THREADING= @@ -19,15 +23,26 @@ - HOST= WINE= DECODESTREAMS=libde265-teststreams-weighted THREADING=--single-threaded - HOST= WINE= DECODESTREAMS=libde265-teststreams-wpp-nolf THREADING= - HOST= WINE= DECODESTREAMS=libde265-teststreams-wpp-nolf THREADING=--single-threaded - - HOST=i686-w64-mingw32 WINE=wine DECODESTREAMS= - - HOST=x86_64-w64-mingw32 WINE=wine64 DECODESTREAMS= - - HOST=arm-linux-gnueabihf WINE= DECODESTREAMS= - - HOST=cmake WINE= DECODESTREAMS= matrix: include: - compiler: clang env: HOST= WINE= DECODESTREAMS= + allow_failures: + - env: HOST= WINE= DECODESTREAMS=libde265-teststreams-fuzzing THREADING= + - env: HOST= WINE= DECODESTREAMS=libde265-teststreams-fuzzing THREADING=--single-threaded + - env: HOST= WINE= DECODESTREAMS=libde265-teststreams-nolf THREADING= + - env: HOST= WINE= DECODESTREAMS=libde265-teststreams-nolf THREADING=--single-threaded + - env: HOST= WINE= DECODESTREAMS=libde265-teststreams-sao THREADING= + - env: HOST= WINE= DECODESTREAMS=libde265-teststreams-sao THREADING=--single-threaded + - env: HOST= WINE= DECODESTREAMS=libde265-teststreams-tiles THREADING= + - env: HOST= WINE= DECODESTREAMS=libde265-teststreams-tiles THREADING=--single-threaded + - env: HOST= WINE= DECODESTREAMS=libde265-teststreams-tiles-nolf THREADING= + - env: HOST= WINE= DECODESTREAMS=libde265-teststreams-tiles-nolf THREADING=--single-threaded + - env: HOST= WINE= DECODESTREAMS=libde265-teststreams-weighted THREADING= + - env: HOST= WINE= DECODESTREAMS=libde265-teststreams-weighted THREADING=--single-threaded + - env: HOST= WINE= DECODESTREAMS=libde265-teststreams-wpp-nolf THREADING= + - env: HOST= WINE= DECODESTREAMS=libde265-teststreams-wpp-nolf THREADING=--single-threaded before_install: - sh -c "if [ ! -z '$DECODESTREAMS' ]; then sudo add-apt-repository -y ppa:strukturag/libde265; fi" @@ -35,10 +50,11 @@ - sh -c "if [ -z '$HOST' ]; then sudo apt-get install -qq valgrind libsdl-dev libqt4-dev libswscale-dev; fi" - sh -c "if [ -z '$HOST' ] && [ -z '$DECODESTREAMS' ]; then sudo apt-get install -qq devscripts; fi" - sh -c "if [ ! -z '$WINE' ]; then sudo apt-get install -qq wine; fi" - - sh -c "if [ '$WINE' = 'wine' ]; then sudo apt-get install -qq gcc-mingw-w64-i686 g++-mingw-w64-i686 binutils-mingw-w64-i686 mingw-w64-dev; fi" - - sh -c "if [ '$WINE' = 'wine64' ]; then sudo apt-get install -qq gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-dev; fi" + - sh -c "if [ '$WINE' = 'wine' ]; then sudo apt-get install -qq gcc-mingw-w64-i686 g++-mingw-w64-i686 binutils-mingw-w64-i686 mingw-w64-i686-dev; fi" + - sh -c "if [ '$WINE' = 'wine64' ]; then sudo apt-get install -qq gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-x86-64-dev; fi" - sh -c "if ( echo '$HOST' | grep -q '^arm' ); then sudo apt-get install -qq g++-arm-linux-gnueabihf gcc-arm-linux-gnueabihf qemu-user; fi" - sh -c "if [ ! -z '$DECODESTREAMS' ]; then sudo apt-get install $DECODESTREAMS; fi" + - sudo apt-get install cmake install: - git clone https://github.com/strukturag/libde265-data.git @@ -50,19 +66,22 @@ - if [ "$HOST" != "cmake" ]; then ./configure --host=$HOST; fi - if [ "$HOST" = "cmake" ]; then cmake .; fi +# inter-streams are valgrinded without SSE, because it gives too many false positives in put_hevc_qpel() +# intra-streams use SSE, because they run fine in valgrind + script: - sh -c "if [ -z "$HOST" ] && [ -z "$DECODESTREAMS" ]; then ./scripts/check_licenses.sh; fi" - make - sh -c "if [ -z "$HOST" ] && [ -z "$DECODESTREAMS" ]; then make dist && mkdir dist-test && cd dist-test && tar xzf ../libde265-*.tar.gz && cd libde265-* && ./configure && make; fi" - sh -c "if [ -z "$HOST" ] && [ -z "$DECODESTREAMS" ]; then make dist && mkdir dist-cmake-test && cd dist-cmake-test && tar xzf ../libde265-*.tar.gz && cd libde265-* && cmake . && make; fi" - - sh -c "if [ -z "$HOST" ] && [ -z "$DECODESTREAMS" ]; then LD_LIBRARY_PATH=./libde265/.libs/ valgrind --tool=memcheck --quiet --error-exitcode=1 ./dec265/.libs/dec265 -q -c -f 100 ./libde265-data/IDR-only/paris-352x288-intra.bin; fi" - - sh -c "if [ -z "$HOST" ] && [ -z "$DECODESTREAMS" ]; then LD_LIBRARY_PATH=./libde265/.libs/ valgrind --tool=memcheck --quiet --error-exitcode=1 ./dec265/.libs/dec265 -t 4 -q -c -f 100 ./libde265-data/IDR-only/paris-352x288-intra.bin; fi" - - sh -c "if [ -z "$HOST" ] && [ -z "$DECODESTREAMS" ]; then LD_LIBRARY_PATH=./libde265/.libs/ valgrind --tool=memcheck --quiet --error-exitcode=1 ./dec265/.libs/dec265 -q -c -f 100 ./libde265-data/RandomAccess/paris-ra-wpp.bin; fi" - - sh -c "if [ -z "$HOST" ] && [ -z "$DECODESTREAMS" ]; then LD_LIBRARY_PATH=./libde265/.libs/ valgrind --tool=memcheck --quiet --error-exitcode=1 ./dec265/.libs/dec265 -t 4 -q -c -f 100 ./libde265-data/RandomAccess/paris-ra-wpp.bin; fi" - - sh -c "if [ ! -z "$WINE" ]; then WINEPREFIX=`pwd`/$WINE WINEPATH=/usr/lib/gcc/$HOST/4.6/ $WINE ./dec265/dec265.exe -q -c ./libde265-data/IDR-only/paris-352x288-intra.bin; fi" - - sh -c "if [ ! -z "$WINE" ]; then WINEPREFIX=`pwd`/$WINE WINEPATH=/usr/lib/gcc/$HOST/4.6/ $WINE ./dec265/dec265.exe -t 4 -q -c ./libde265-data/IDR-only/paris-352x288-intra.bin; fi" - - sh -c "if [ ! -z "$WINE" ]; then WINEPREFIX=`pwd`/$WINE WINEPATH=/usr/lib/gcc/$HOST/4.6/ $WINE ./dec265/dec265.exe -q -c ./libde265-data/RandomAccess/paris-ra-wpp.bin; fi" - - sh -c "if [ ! -z "$WINE" ]; then WINEPREFIX=`pwd`/$WINE WINEPATH=/usr/lib/gcc/$HOST/4.6/ $WINE ./dec265/dec265.exe -t 4 -q -c ./libde265-data/RandomAccess/paris-ra-wpp.bin; fi" + - sh -c "if [ -z "$HOST" ] && [ -z "$DECODESTREAMS" ]; then LD_LIBRARY_PATH=./libde265/.libs/ valgrind --tool=memcheck --quiet --error-exitcode=1 --gen-suppressions=all --suppressions=valgrind.supp ./dec265/.libs/dec265 -q -c -f 100 ./libde265-data/IDR-only/paris-352x288-intra.bin; fi" + - sh -c "if [ -z "$HOST" ] && [ -z "$DECODESTREAMS" ]; then LD_LIBRARY_PATH=./libde265/.libs/ valgrind --tool=memcheck --quiet --error-exitcode=1 --gen-suppressions=all --suppressions=valgrind.supp ./dec265/.libs/dec265 -t 4 -q -c -f 100 ./libde265-data/IDR-only/paris-352x288-intra.bin; fi" + - sh -c "if [ -z "$HOST" ] && [ -z "$DECODESTREAMS" ]; then LD_LIBRARY_PATH=./libde265/.libs/ valgrind --tool=memcheck --quiet --error-exitcode=1 --gen-suppressions=all --suppressions=valgrind.supp ./dec265/.libs/dec265 -0 -q -c -f 100 ./libde265-data/RandomAccess/paris-ra-wpp.bin; fi" + - sh -c "if [ -z "$HOST" ] && [ -z "$DECODESTREAMS" ]; then LD_LIBRARY_PATH=./libde265/.libs/ valgrind --tool=memcheck --quiet --error-exitcode=1 --gen-suppressions=all --suppressions=valgrind.supp ./dec265/.libs/dec265 -0 -t 4 -q -c -f 100 ./libde265-data/RandomAccess/paris-ra-wpp.bin; fi" + - sh -c "if [ ! -z "$WINE" ]; then WINEPREFIX=`pwd`/$WINE WINEPATH=\"/usr/lib/gcc/$HOST/4.8/\;/usr/$HOST/lib\" $WINE ./dec265/dec265.exe -q -c ./libde265-data/IDR-only/paris-352x288-intra.bin; fi" + - sh -c "if [ ! -z "$WINE" ]; then WINEPREFIX=`pwd`/$WINE WINEPATH=\"/usr/lib/gcc/$HOST/4.8/\;/usr/$HOST/lib\" $WINE ./dec265/dec265.exe -t 4 -q -c ./libde265-data/IDR-only/paris-352x288-intra.bin; fi" + - sh -c "if [ ! -z "$WINE" ]; then WINEPREFIX=`pwd`/$WINE WINEPATH=\"/usr/lib/gcc/$HOST/4.8/\;/usr/$HOST/lib\" $WINE ./dec265/dec265.exe -q -c ./libde265-data/RandomAccess/paris-ra-wpp.bin; fi" + - sh -c "if [ ! -z "$WINE" ]; then WINEPREFIX=`pwd`/$WINE WINEPATH=\"/usr/lib/gcc/$HOST/4.8/\;/usr/$HOST/lib\" $WINE ./dec265/dec265.exe -t 4 -q -c ./libde265-data/RandomAccess/paris-ra-wpp.bin; fi" - sh -c "if ( echo '$HOST' | grep -q '^arm' ); then LD_LIBRARY_PATH=`pwd`/libde265/.libs/ qemu-arm -L /usr/$HOST ./dec265/.libs/dec265 -q -c ./libde265-data/IDR-only/paris-352x288-intra.bin; fi" #- sh -c "if ( echo '$HOST' | grep -q '^arm' ); then LD_LIBRARY_PATH=`pwd`/libde265/.libs/ qemu-arm -L /usr/$HOST ./dec265/.libs/dec265 -t 4 -q -c ./libde265-data/IDR-only/paris-352x288-intra.bin; fi" - sh -c "if ( echo '$HOST' | grep -q '^arm' ); then LD_LIBRARY_PATH=`pwd`/libde265/.libs/ qemu-arm -L /usr/$HOST ./dec265/.libs/dec265 -q -c ./libde265-data/RandomAccess/paris-ra-wpp.bin; fi"
View file
libde265-1.0.2.tar.gz/CMakeLists.txt -> libde265-1.0.3.tar.gz/CMakeLists.txt
Changed
@@ -1,5 +1,5 @@ project (libde265) -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 2.8.8) # The version number. set (NUMERIC_VERSION 0x01000000)
View file
libde265-1.0.2.tar.gz/Makefile.am -> libde265-1.0.3.tar.gz/Makefile.am
Changed
@@ -9,8 +9,8 @@ endif SUBDIRS+=enc265 - SUBDIRS+=tools +SUBDIRS+=acceleration-speed if ENABLE_SHERLOCK265 SUBDIRS+=sherlock265
View file
libde265-1.0.2.tar.gz/Makefile.in -> libde265-1.0.3.tar.gz/Makefile.in
Changed
@@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -15,7 +15,17 @@ @SET_MAKE@ VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -82,12 +92,6 @@ @ENABLE_DEC265_TRUE@am__append_1 = dec265 @ENABLE_SHERLOCK265_TRUE@am__append_2 = sherlock265 subdir = . -DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ - $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/configure $(am__configure_deps) \ - $(srcdir)/config.h.in $(srcdir)/libde265.pc.in COPYING TODO \ - compile config.guess config.sub depcomp install-sh missing \ - ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ @@ -98,6 +102,8 @@ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d @@ -189,7 +195,12 @@ ETAGS = etags CTAGS = ctags CSCOPE = cscope -DIST_SUBDIRS = libde265 dec265 enc265 tools sherlock265 +DIST_SUBDIRS = libde265 dec265 enc265 tools acceleration-speed \ + sherlock265 +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(srcdir)/libde265.pc.in AUTHORS COPYING ChangeLog INSTALL \ + NEWS README compile config.guess config.sub depcomp install-sh \ + ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -283,6 +294,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -365,6 +377,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -377,7 +390,8 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = libde265 $(am__append_1) enc265 tools $(am__append_2) +SUBDIRS = libde265 $(am__append_1) enc265 tools acceleration-speed \ + $(am__append_2) ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = .travis.yml \ autogen.sh \ @@ -410,7 +424,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -664,15 +677,15 @@ $(am__post_remove_distdir) dist-tarZ: distdir - @echo WARNING: "Support for shar distribution archives is" \ - "deprecated." >&2 + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir - @echo WARNING: "Support for distribution archives compressed with" \ - "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) @@ -708,17 +721,17 @@ esac chmod -R a-w $(distdir) chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_inst + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ - && ../configure \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ - --srcdir=.. --prefix="$$dc_install_base" \ + --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -898,6 +911,8 @@ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-pkgconfigDATA +.PRECIOUS: Makefile + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded.
View file
libde265-1.0.2.tar.gz/README.md -> libde265-1.0.3.tar.gz/README.md
Changed
@@ -52,7 +52,7 @@ Building ======== -[![Build Status](https://travis-ci.org/strukturag/libde265.png?branch=master)](https://travis-ci.org/strukturag/libde265) +[![Build Status](https://travis-ci.org/strukturag/libde265.png?branch=master)](https://travis-ci.org/strukturag/libde265) [![Build Status](https://ci.appveyor.com/api/projects/status/github/strukturag/libde265?svg=true)](https://ci.appveyor.com/project/strukturag/libde265) If you got libde265 from the git repository, you will first need to run the included `autogen.sh` script to generate the `configure` script.
View file
libde265-1.0.3.tar.gz/acceleration-speed
Added
+(directory)
View file
libde265-1.0.3.tar.gz/acceleration-speed/Makefile.am
Added
@@ -0,0 +1,17 @@ + +bin_PROGRAMS = acceleration_speed + +AM_CPPFLAGS = -I../libde265 + +acceleration_speed_DEPENDENCIES = ../libde265/libde265.la +acceleration_speed_CXXFLAGS = +acceleration_speed_LDFLAGS = +acceleration_speed_LDADD = ../libde265/libde265.la -lstdc++ +acceleration_speed_SOURCES = \ + acceleration-speed.cc acceleration-speed.h \ + dct.cc dct.h \ + dct-scalar.cc dct-scalar.h + +if ENABLE_SSE_OPT + acceleration_speed_SOURCES += dct-sse.cc +endif
View file
libde265-1.0.3.tar.gz/acceleration-speed/Makefile.in
Added
@@ -0,0 +1,756 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +bin_PROGRAMS = acceleration_speed$(EXEEXT) +@ENABLE_SSE_OPT_TRUE@am__append_1 = dct-sse.cc +subdir = acceleration-speed +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ + $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/m4_ax_check_compile_flag.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am__acceleration_speed_SOURCES_DIST = acceleration-speed.cc \ + acceleration-speed.h dct.cc dct.h dct-scalar.cc dct-scalar.h \ + dct-sse.cc +@ENABLE_SSE_OPT_TRUE@am__objects_1 = \ +@ENABLE_SSE_OPT_TRUE@ acceleration_speed-dct-sse.$(OBJEXT) +am_acceleration_speed_OBJECTS = \ + acceleration_speed-acceleration-speed.$(OBJEXT) \ + acceleration_speed-dct.$(OBJEXT) \ + acceleration_speed-dct-scalar.$(OBJEXT) $(am__objects_1) +acceleration_speed_OBJECTS = $(am_acceleration_speed_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +acceleration_speed_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ + $(acceleration_speed_CXXFLAGS) $(CXXFLAGS) \ + $(acceleration_speed_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 +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +AM_V_CXX = $(am__v_CXX_@AM_V@) +am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) +am__v_CXX_0 = @echo " CXX " $@; +am__v_CXX_1 = +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) +am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) +am__v_CXXLD_0 = @echo " CXXLD " $@; +am__v_CXXLD_1 = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(acceleration_speed_SOURCES) +DIST_SOURCES = $(am__acceleration_speed_SOURCES_DIST) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables
View file
libde265-1.0.3.tar.gz/acceleration-speed/acceleration-speed.cc
Added
@@ -0,0 +1,219 @@ +/* + * H.265 video codec. + * Copyright (c) 2015 struktur AG, Dirk Farin <farin@struktur.de> + * + * This file is part of libde265. + * + * libde265 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * libde265 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with libde265. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <getopt.h> + +#include <string> +#include <stack> +#include <memory> + +#include "libde265/image.h" +#include "libde265/fallback-dct.h" +#include "libde265/image-io.h" + +#include "acceleration-speed.h" + + +/* TODO: for more realistic input to IDCTs, we could save the real coefficients in + a decoder run and use this data as input. + */ + + +bool show_help=false; +bool do_check=false; +bool do_time=false; +bool do_eval=false; +int img_width=352; +int img_height=288; +int nframes=1000; +int repeat=10; +std::string function; +std::string input_file; + +static struct option long_options[] = { + {"help", no_argument, 0, 'H' }, + {"input", required_argument, 0, 'i' }, + {"width", required_argument, 0, 'w' }, + {"height", required_argument, 0, 'h' }, + {"nframes", required_argument, 0, 'n' }, + {"function",required_argument, 0, 'f' }, + {"check", no_argument, 0, 'c' }, + {"time", no_argument, 0, 't' }, + {"eval", no_argument, 0, 'e' }, + {"repeat", required_argument, 0, 'r' }, + {0, 0, 0, 0 } +}; + + + +DSPFunc* DSPFunc::first = NULL; + + +bool DSPFunc::runOnImage(std::shared_ptr<const de265_image> img, bool compareToReference) +{ + int w = img->get_width(0); + int h = img->get_height(0); + + int blkWidth = getBlkWidth(); + int blkHeight = getBlkHeight(); + + bool success = true; + + for (int y=0;y<=h-blkHeight;y+=blkHeight) + for (int x=0;x<=w-blkWidth;x+=blkWidth) { + runOnBlock(x,y); + + if (compareToReference) { + referenceImplementation()->runOnBlock(x,y); + success &= compareToReferenceImplementation(); + } + } + + return success; +} + + + +int main(int argc, char** argv) +{ + while (1) { + int option_index = 0; + + int c = getopt_long(argc, argv, "Hci:w:h:n:f:ter:", long_options, &option_index); + if (c == -1) + break; + + switch (c) { + case 'H': show_help=true; break; + case 'c': do_check=true; break; + case 'w': img_width =atoi(optarg); break; + case 'h': img_height=atoi(optarg); break; + case 'n': nframes=atoi(optarg); break; + case 'f': function=optarg; break; + case 'i': input_file=optarg; break; + case 't': do_time=true; break; + case 'e': do_eval=true; break; + case 'r': repeat=atoi(optarg); break; + } + } + + + if (show_help) { + fprintf(stderr, + "acceleration-speed SIMD DSP function testing tool\n" + "--------------------------------------------------\n" + " --help show help\n" + " -i, --input NAME input YUV file\n" + " -w, --width # input width (default: 352)\n" + " -h, --height # input height (default: 288)\n" + " -n, --nframes # number of frames to process (default: 1000)\n" + " -f, --function NAME which function to test (see below)\n" + " -r, --repeat # number of repetitions for each image (default: 10)\n" + " -c, --check compare function result against its reference code\n" + "\n" + "these functions are known:\n" + ); + + std::stack<const char*> funcnames; + + for (DSPFunc* func = DSPFunc::first; + func ; + func=func->next) { + funcnames.push(func->name()); + } + + while (!funcnames.empty()) { + fprintf(stderr, + " %s\n", funcnames.top()); + funcnames.pop(); + } + + return 0; + } + + + // --- find DSP function with the given name --- + + if (function.empty()) { + fprintf(stderr,"No function specified. Use option '--function'.\n"); + exit(10); + } + + DSPFunc* algo = NULL; + for (DSPFunc* f = DSPFunc::first; f ; f=f->next) { + if (strcasecmp(f->name(), function.c_str())==0) { + algo = f; + break; + } + } + + if (algo==NULL) { + fprintf(stderr,"Argument to '--function' invalid. No function with that name.\n"); + exit(10); + } + + if (do_check && !algo->referenceImplementation()) { + fprintf(stderr,"cannot check function result: no reference function defined for the selected function.\n"); + exit(10); + } + + + ImageSource_YUV image_source; + image_source.set_input_file(input_file.c_str(), img_width, img_height); + + int img_counter=0; + + bool eof = false; + for (int f=0; f<nframes ; f++) + { + std::shared_ptr<de265_image> image(image_source.get_image()); + if (!image) { + eof=true; + break; + } + + img_counter++;
View file
libde265-1.0.3.tar.gz/acceleration-speed/acceleration-speed.h
Added
@@ -0,0 +1,65 @@ +/* + * H.265 video codec. + * Copyright (c) 2015 struktur AG, Dirk Farin <farin@struktur.de> + * + * This file is part of libde265. + * + * libde265 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * libde265 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with libde265. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef ACCELERATION_SPEED_H +#define ACCELERATION_SPEED_H + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <getopt.h> + +#include <string> +#include <stack> +#include <memory> + +#include "libde265/image.h" +#include "libde265/image-io.h" + + +class DSPFunc +{ +public: + DSPFunc() { next = first; first = this; } + virtual ~DSPFunc() { } + + virtual const char* name() const = 0; + + virtual int getBlkWidth() const = 0; + virtual int getBlkHeight() const = 0; + + virtual void runOnBlock(int x,int y) = 0; + virtual DSPFunc* referenceImplementation() const { return NULL; } + + virtual bool prepareNextImage(std::shared_ptr<const de265_image>) = 0; + + bool runOnImage(std::shared_ptr<const de265_image> img, bool compareToReference); + virtual bool compareToReferenceImplementation() { return false; } + + static DSPFunc* first; + DSPFunc* next; +}; + + +#endif
View file
libde265-1.0.3.tar.gz/acceleration-speed/dct-scalar.cc
Added
@@ -0,0 +1,33 @@ +/* + * H.265 video codec. + * Copyright (c) 2015 struktur AG, Dirk Farin <farin@struktur.de> + * + * This file is part of libde265. + * + * libde265 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * libde265 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with libde265. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "dct-scalar.h" + + +DSPFunc_FDCT_Scalar_4x4 fdct_scalar_4x4; +DSPFunc_FDCT_Scalar_8x8 fdct_scalar_8x8; +DSPFunc_FDCT_Scalar_16x16 fdct_scalar_16x16; +DSPFunc_FDCT_Scalar_32x32 fdct_scalar_32x32; + + +DSPFunc_IDCT_Scalar_4x4 idct_scalar_4x4; +DSPFunc_IDCT_Scalar_8x8 idct_scalar_8x8; +DSPFunc_IDCT_Scalar_16x16 idct_scalar_16x16; +DSPFunc_IDCT_Scalar_32x32 idct_scalar_32x32;
View file
libde265-1.0.3.tar.gz/acceleration-speed/dct-scalar.h
Added
@@ -0,0 +1,158 @@ +/* + * H.265 video codec. + * Copyright (c) 2015 struktur AG, Dirk Farin <farin@struktur.de> + * + * This file is part of libde265. + * + * libde265 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * libde265 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with libde265. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef ACCELERATION_SPEED_DCT_SCALAR_H +#define ACCELERATION_SPEED_DCT_SCALAR_H + +#include "dct.h" + +class DSPFunc_FDCT_Scalar_4x4 : public DSPFunc_FDCT_Base +{ +public: + DSPFunc_FDCT_Scalar_4x4() : DSPFunc_FDCT_Base(4) { } + + virtual const char* name() const { return "FDCT-Scalar-4x4"; } + + virtual void runOnBlock(int x,int y) { + bool D = false; + + fdct_4x4_8_fallback(coeffs, residuals+x+y*stride, stride); + + if (D) { dump(x,y); } + } +}; + + +class DSPFunc_FDCT_Scalar_8x8 : public DSPFunc_FDCT_Base +{ +public: + DSPFunc_FDCT_Scalar_8x8() : DSPFunc_FDCT_Base(8) { } + + virtual const char* name() const { return "FDCT-Scalar-8x8"; } + + virtual void runOnBlock(int x,int y) { + bool D = false; + + fdct_8x8_8_fallback(coeffs, residuals+x+y*stride, stride); + + if (D) { dump(x,y); } + } +}; + + +class DSPFunc_FDCT_Scalar_16x16 : public DSPFunc_FDCT_Base +{ +public: + DSPFunc_FDCT_Scalar_16x16() : DSPFunc_FDCT_Base(16) { } + + virtual const char* name() const { return "FDCT-Scalar-16x16"; } + + virtual void runOnBlock(int x,int y) { + bool D = false; + + fdct_16x16_8_fallback(coeffs, residuals+x+y*stride, stride); + + if (D) { dump(x,y); } + } +}; + +class DSPFunc_FDCT_Scalar_32x32 : public DSPFunc_FDCT_Base +{ +public: + DSPFunc_FDCT_Scalar_32x32() : DSPFunc_FDCT_Base(32) { } + + virtual const char* name() const { return "FDCT-Scalar-32x32"; } + + virtual void runOnBlock(int x,int y) { + bool D = false; + + fdct_32x32_8_fallback(coeffs, residuals+x+y*stride, stride); + + if (D) { dump(x,y); } + } +}; + + + +class DSPFunc_IDCT_Scalar_4x4 : public DSPFunc_IDCT_Base +{ +public: + DSPFunc_IDCT_Scalar_4x4() : DSPFunc_IDCT_Base(4) { } + + virtual const char* name() const { return "IDCT-Scalar-4x4"; } + + virtual void runOnBlock(int x,int y) { + memset(out,0,4*4); + transform_4x4_add_8_fallback(out, xy2coeff(x,y), 4); + } +}; + +class DSPFunc_IDCT_Scalar_8x8 : public DSPFunc_IDCT_Base +{ +public: + DSPFunc_IDCT_Scalar_8x8() : DSPFunc_IDCT_Base(8) { } + + virtual const char* name() const { return "IDCT-Scalar-8x8"; } + + virtual void runOnBlock(int x,int y) { + memset(out,0,8*8); + transform_8x8_add_8_fallback(out, xy2coeff(x,y), 8); + } +}; + +class DSPFunc_IDCT_Scalar_16x16 : public DSPFunc_IDCT_Base +{ +public: + DSPFunc_IDCT_Scalar_16x16() : DSPFunc_IDCT_Base(16) { } + + virtual const char* name() const { return "IDCT-Scalar-16x16"; } + + virtual void runOnBlock(int x,int y) { + memset(out,0,16*16); + transform_16x16_add_8_fallback(out, xy2coeff(x,y), 16); + } +}; + +class DSPFunc_IDCT_Scalar_32x32 : public DSPFunc_IDCT_Base +{ +public: + DSPFunc_IDCT_Scalar_32x32() : DSPFunc_IDCT_Base(32) { } + + virtual const char* name() const { return "IDCT-Scalar-32x32"; } + + virtual void runOnBlock(int x,int y) { + memset(out,0,32*32); + transform_32x32_add_8_fallback(out, xy2coeff(x,y), 32); + } +}; + + +extern DSPFunc_FDCT_Scalar_4x4 fdct_scalar_4x4; +extern DSPFunc_FDCT_Scalar_8x8 fdct_scalar_8x8; +extern DSPFunc_FDCT_Scalar_16x16 fdct_scalar_16x16; +extern DSPFunc_FDCT_Scalar_32x32 fdct_scalar_32x32; + + +extern DSPFunc_IDCT_Scalar_4x4 idct_scalar_4x4; +extern DSPFunc_IDCT_Scalar_8x8 idct_scalar_8x8; +extern DSPFunc_IDCT_Scalar_16x16 idct_scalar_16x16; +extern DSPFunc_IDCT_Scalar_32x32 idct_scalar_32x32; + +#endif
View file
libde265-1.0.3.tar.gz/acceleration-speed/dct-sse.cc
Added
@@ -0,0 +1,177 @@ +/* + * H.265 video codec. + * Copyright (c) 2015 struktur AG, Dirk Farin <farin@struktur.de> + * + * This file is part of libde265. + * + * libde265 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * libde265 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with libde265. If not, see <http://www.gnu.org/licenses/>. + */ + + +#include "libde265/x86/sse-dct.h" +#include "dct.h" +#include "dct-scalar.h" + + +class DSPFunc_IDCT_SSE_4x4 : public DSPFunc_IDCT_Base +{ +public: + DSPFunc_IDCT_SSE_4x4() : DSPFunc_IDCT_Base(4) { } + + virtual const char* name() const { return "IDCT-SSE-4x4"; } + + virtual DSPFunc* referenceImplementation() const { return &idct_scalar_4x4; } + + virtual void runOnBlock(int x,int y) { + memset(out,0,4*4); + ff_hevc_transform_4x4_add_8_sse4(out, xy2coeff(x,y), 4); + } +}; + +class DSPFunc_IDCT_SSE_8x8 : public DSPFunc_IDCT_Base +{ +public: + DSPFunc_IDCT_SSE_8x8() : DSPFunc_IDCT_Base(8) { } + + virtual const char* name() const { return "IDCT-SSE-8x8"; } + + virtual DSPFunc* referenceImplementation() const { return &idct_scalar_8x8; } + + virtual void runOnBlock(int x,int y) { + memset(out,0,8*8); + ff_hevc_transform_8x8_add_8_sse4(out, xy2coeff(x,y), 8); + } +}; + +class DSPFunc_IDCT_SSE_16x16 : public DSPFunc_IDCT_Base +{ +public: + DSPFunc_IDCT_SSE_16x16() : DSPFunc_IDCT_Base(16) { } + + virtual const char* name() const { return "IDCT-SSE-16x16"; } + + virtual DSPFunc* referenceImplementation() const { return &idct_scalar_16x16; } + + virtual void runOnBlock(int x,int y) { + memset(out,0,16*16); + ff_hevc_transform_16x16_add_8_sse4(out, xy2coeff(x,y), 16); + } +}; + +class DSPFunc_IDCT_SSE_32x32 : public DSPFunc_IDCT_Base +{ +public: + DSPFunc_IDCT_SSE_32x32() : DSPFunc_IDCT_Base(32) { } + + virtual const char* name() const { return "IDCT-SSE-32x32"; } + + virtual DSPFunc* referenceImplementation() const { return &idct_scalar_32x32; } + + virtual void runOnBlock(int x,int y) { + memset(out,0,32*32); + ff_hevc_transform_32x32_add_8_sse4(out, xy2coeff(x,y), 32); + } +}; + +DSPFunc_IDCT_SSE_4x4 idct_sse_4x4; +DSPFunc_IDCT_SSE_8x8 idct_sse_8x8; +DSPFunc_IDCT_SSE_16x16 idct_sse_16x16; +DSPFunc_IDCT_SSE_32x32 idct_sse_32x32; + + + + + +class DSPFunc_FDCT_SSE_4x4 : public DSPFunc_FDCT_Base +{ +public: + DSPFunc_FDCT_SSE_4x4() : DSPFunc_FDCT_Base(4) { } + + virtual const char* name() const { return "FDCT-SSE-4x4-to-be-implemented"; } + + virtual DSPFunc* referenceImplementation() const { return &fdct_scalar_4x4; } + + virtual void runOnBlock(int x,int y) { + // <<< function to be implemented >>> + + // fdct_4x4_8_fallback(coeffs, residuals+x+y*stride, stride); + + bool D = false; + if (D) { dump(x,y); } + } +}; + + +class DSPFunc_FDCT_SSE_8x8 : public DSPFunc_FDCT_Base +{ +public: + DSPFunc_FDCT_SSE_8x8() : DSPFunc_FDCT_Base(8) { } + + virtual const char* name() const { return "FDCT-SSE-8x8-to-be-implemented"; } + + virtual DSPFunc* referenceImplementation() const { return &fdct_scalar_8x8; } + + virtual void runOnBlock(int x,int y) { + // <<< function to be implemented >>> + + // fdct_8x8_8_fallback(coeffs, residuals+x+y*stride, stride); + + bool D = false; + if (D) { dump(x,y); } + } +}; + + +class DSPFunc_FDCT_SSE_16x16 : public DSPFunc_FDCT_Base +{ +public: + DSPFunc_FDCT_SSE_16x16() : DSPFunc_FDCT_Base(16) { } + + virtual const char* name() const { return "FDCT-SSE-16x16-to-be-implemented"; } + + virtual DSPFunc* referenceImplementation() const { return &fdct_scalar_16x16; } + + virtual void runOnBlock(int x,int y) { + // <<< function to be implemented >>> + + // fdct_16x16_8_fallback(coeffs, residuals+x+y*stride, stride); + + bool D = false; + if (D) { dump(x,y); } + } +}; + +class DSPFunc_FDCT_SSE_32x32 : public DSPFunc_FDCT_Base +{ +public: + DSPFunc_FDCT_SSE_32x32() : DSPFunc_FDCT_Base(32) { } + + virtual const char* name() const { return "FDCT-SSE-32x32-to-be-implemented"; } + + virtual DSPFunc* referenceImplementation() const { return &fdct_scalar_32x32; } + + virtual void runOnBlock(int x,int y) { + // <<< function to be implemented >>> + + // fdct_32x32_8_fallback(coeffs, residuals+x+y*stride, stride); + + bool D = false; + if (D) { dump(x,y); } + } +}; + +DSPFunc_FDCT_SSE_4x4 fdct_sse_4x4; +DSPFunc_FDCT_SSE_8x8 fdct_sse_8x8; +DSPFunc_FDCT_SSE_16x16 fdct_sse_16x16; +DSPFunc_FDCT_SSE_32x32 fdct_sse_32x32;
View file
libde265-1.0.3.tar.gz/acceleration-speed/dct.cc
Added
@@ -0,0 +1,144 @@ +/* + * H.265 video codec. + * Copyright (c) 2015 struktur AG, Dirk Farin <farin@struktur.de> + * + * This file is part of libde265. + * + * libde265 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * libde265 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with libde265. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "dct.h" + + +// --- FDCT --- + +void DSPFunc_FDCT_Base::dump(int x,int y) +{ + printf("-> "); + for (int yy=0;yy<blkSize;yy++) + for (int xx=0;xx<blkSize;xx++) + printf("%d ", *(residuals+x+xx+(y+yy)*stride)); + printf("\n"); + + printf(" "); + for (int x=0;x<blkSize*blkSize;x++) + printf("%d ", coeffs[x]); + printf("\n"); + + int32_t out[32*32]; + transform_idct_8x8_fallback(out, coeffs, 20-8, 15); + + printf(" "); + for (int x=0;x<blkSize*blkSize;x++) + printf("%d ", out[x]); + printf("\n"); +} + + +bool DSPFunc_FDCT_Base::compareToReferenceImplementation() +{ + DSPFunc_FDCT_Base* refImpl = dynamic_cast<DSPFunc_FDCT_Base*>(referenceImplementation()); + + for (int i=0;i<blkSize*blkSize;i++) + if (coeffs[i] != refImpl->coeffs[i]) + return false; + + return true; +} + + +bool DSPFunc_FDCT_Base::prepareNextImage(std::shared_ptr<const de265_image> img) +{ + if (!curr_image) { + curr_image = img; + return false; + } + + prev_image = curr_image; + curr_image = img; + + int w = curr_image->get_width(0); + int h = curr_image->get_height(0); + + if (residuals==NULL) { + int align=16; + stride = (w+align-1)/align*align; + residuals = new int16_t[stride*h]; + } + + int cstride = curr_image->get_luma_stride(); + int pstride = prev_image->get_luma_stride(); + const uint8_t* curr = curr_image->get_image_plane_at_pos(0,0,0); + const uint8_t* prev = prev_image->get_image_plane_at_pos(0,0,0); + + for (int y=0;y<h;y++) + for (int x=0;x<w;x++) { + residuals[y*stride+x] = curr[y*cstride+x] - prev[y*pstride+x]; + } + + return true; +} + + +// --- IDCT --- + +bool DSPFunc_IDCT_Base::compareToReferenceImplementation() +{ + DSPFunc_IDCT_Base* refImpl = dynamic_cast<DSPFunc_IDCT_Base*>(referenceImplementation()); + + for (int i=0;i<blkSize*blkSize;i++) + if (out[i] != refImpl->out[i]) + return false; + + return true; +} + + +bool DSPFunc_IDCT_Base::prepareNextImage(std::shared_ptr<const de265_image> img) +{ + // --- generate fake coefficients --- + // difference between two frames + + if (!curr_image) { + curr_image = img; + return false; + } + + prev_image = curr_image; + curr_image = img; + + int w = curr_image->get_width(0); + int h = curr_image->get_height(0); + + int align = blkSize; + width = (w+align-1) / align * align; + + blksPerRow = w/blkSize; + + if (coeffs==NULL) { + coeffs = new int16_t[width*h]; + } + + int cstride = curr_image->get_luma_stride(); + int pstride = prev_image->get_luma_stride(); + const uint8_t* curr = curr_image->get_image_plane_at_pos(0,0,0); + const uint8_t* prev = prev_image->get_image_plane_at_pos(0,0,0); + + for (int y=0;y<h;y++) + for (int x=0;x<w;x++) { + coeffs[y*w+x] = curr[y*cstride+x] - prev[y*pstride+x]; + } + + return true; +}
View file
libde265-1.0.3.tar.gz/acceleration-speed/dct.h
Added
@@ -0,0 +1,111 @@ +/* + * H.265 video codec. + * Copyright (c) 2015 struktur AG, Dirk Farin <farin@struktur.de> + * + * This file is part of libde265. + * + * libde265 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * libde265 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with libde265. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef ACCELERATION_SPEED_DCT_H +#define ACCELERATION_SPEED_DCT_H + +#include "acceleration-speed.h" +#include "libde265/fallback-dct.h" + + +class DSPFunc_FDCT_Base : public DSPFunc +{ +public: + DSPFunc_FDCT_Base(int size) { + residuals=NULL; + blkSize=size; + coeffs = new int16_t[size*size]; + } + + virtual const char* name() const { return "FDCT-Base"; } + + virtual int getBlkWidth() const { return blkSize; } + virtual int getBlkHeight() const { return blkSize; } + + virtual void runOnBlock(int x,int y) = 0; + + void dump(int x,int y); + + virtual DSPFunc* referenceImplementation() const { return NULL; } + + bool compareToReferenceImplementation(); + virtual bool prepareNextImage(std::shared_ptr<const de265_image> img); + +private: + std::shared_ptr<const de265_image> prev_image; + std::shared_ptr<const de265_image> curr_image; + +protected: + int blkSize; + + int16_t* residuals; + int stride; + int16_t* coeffs; +}; + + + + + +class DSPFunc_IDCT_Base : public DSPFunc +{ +public: + DSPFunc_IDCT_Base(int size) { + prev_image=NULL; curr_image=NULL; coeffs=NULL; blkSize=size; + out = new uint8_t[size*size]; // allocate it to ensure alignment + } + + virtual const char* name() const { return "IDCT-Base"; } + + virtual int getBlkWidth() const { return blkSize; } + virtual int getBlkHeight() const { return blkSize; } + + virtual void runOnBlock(int x,int y) = 0; + + virtual DSPFunc* referenceImplementation() const { return NULL; } + + virtual bool compareToReferenceImplementation(); + virtual bool prepareNextImage(std::shared_ptr<const de265_image> img); + + inline int16_t* xy2coeff(int x,int y) const { + // note: x+y*width does not make any sense, but gives us some random data + + //int xb = x/blkSize; + //int yb = y/blkSize; + int offset = (x+y*blksPerRow)*blkSize; //(xb+yb*blksPerRow)*blkSize*blkSize; + //printf("%d %d -> %d %p\n", x,y, offset, coeffs+offset); + return coeffs + offset; + } + +private: + std::shared_ptr<const de265_image> prev_image; + std::shared_ptr<const de265_image> curr_image; + +protected: + int blkSize; + + int16_t* coeffs; + int width; + int blksPerRow; + uint8_t* out; // [32*32]; +}; + + +#endif
View file
libde265-1.0.2.tar.gz/aclocal.m4 -> libde265-1.0.3.tar.gz/aclocal.m4
Changed
@@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.14.1 -*- Autoconf -*- +# generated automatically by aclocal 1.15 -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,32 +20,63 @@ If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# serial 1 (pkg-config-0.24) -# -# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# PKG_PROG_PKG_CONFIG([MIN-VERSION]) -# ---------------------------------- +dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +dnl serial 11 (pkg-config-0.29.1) +dnl +dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>. +dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com> +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +dnl 02111-1307, USA. +dnl +dnl As a special exception to the GNU General Public License, if you +dnl distribute this file as part of a program that contains a +dnl configuration script generated by Autoconf, you may include it under +dnl the same distribution terms that you use for the rest of that +dnl program. + +dnl PKG_PREREQ(MIN-VERSION) +dnl ----------------------- +dnl Since: 0.29 +dnl +dnl Verify that the version of the pkg-config macros are at least +dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's +dnl installed version of pkg-config, this checks the developer's version +dnl of pkg.m4 when generating configure. +dnl +dnl To ensure that this macro is defined, also add: +dnl m4_ifndef([PKG_PREREQ], +dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) +dnl +dnl See the "Since" comment for each macro you use to see what version +dnl of the macros you require. +m4_defun([PKG_PREREQ], +[m4_define([PKG_MACROS_VERSION], [0.29.1]) +m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, + [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) +])dnl PKG_PREREQ + +dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) +dnl ---------------------------------- +dnl Since: 0.16 +dnl +dnl Search for the pkg-config tool and set the PKG_CONFIG variable to +dnl first found in the path. Checks that the version of pkg-config found +dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is +dnl used since that's the first version where most current features of +dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) @@ -67,18 +98,19 @@ PKG_CONFIG="" fi fi[]dnl -])# PKG_PROG_PKG_CONFIG +])dnl PKG_PROG_PKG_CONFIG -# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# Check to see whether a particular set of modules exists. Similar -# to PKG_CHECK_MODULES(), but does not set variables or print errors. -# -# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -# only at the first occurence in configure.ac, so if the first place -# it's called might be skipped (such as if it is within an "if", you -# have to call PKG_CHECK_EXISTS manually -# -------------------------------------------------------------- +dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------------------------------- +dnl Since: 0.18 +dnl +dnl Check to see whether a particular set of modules exists. Similar to +dnl PKG_CHECK_MODULES(), but does not set variables or print errors. +dnl +dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +dnl only at the first occurence in configure.ac, so if the first place +dnl it's called might be skipped (such as if it is within an "if", you +dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ @@ -88,8 +120,10 @@ $3])dnl fi]) -# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -# --------------------------------------------- +dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +dnl --------------------------------------------- +dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting +dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" @@ -101,10 +135,11 @@ else pkg_failed=untried fi[]dnl -])# _PKG_CONFIG +])dnl _PKG_CONFIG -# _PKG_SHORT_ERRORS_SUPPORTED -# ----------------------------- +dnl _PKG_SHORT_ERRORS_SUPPORTED +dnl --------------------------- +dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -112,19 +147,17 @@ else _pkg_short_errors_supported=no fi[]dnl -])# _PKG_SHORT_ERRORS_SUPPORTED +])dnl _PKG_SHORT_ERRORS_SUPPORTED -# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -# [ACTION-IF-NOT-FOUND]) -# -# -# Note that if there is a possibility the first call to -# PKG_CHECK_MODULES might not happen, you should be sure to include an -# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -# -# -# -------------------------------------------------------------- +dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl -------------------------------------------------------------- +dnl Since: 0.4.0 +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES might not happen, you should be sure to include an +dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl @@ -178,9 +211,92 @@ AC_MSG_RESULT([yes]) $3 fi[]dnl -])# PKG_CHECK_MODULES +])dnl PKG_CHECK_MODULES + + +dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl --------------------------------------------------------------------- +dnl Since: 0.29 +dnl
View file
libde265-1.0.2.tar.gz/compile -> libde265-1.0.3.tar.gz/compile
Changed
@@ -3,7 +3,7 @@ scriptversion=2012-10-14.11; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey <tromey@cygnus.com>. # # This program is free software; you can redistribute it and/or modify
View file
libde265-1.0.2.tar.gz/config.guess -> libde265-1.0.3.tar.gz/config.guess
Changed
@@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2013 Free Software Foundation, Inc. +# Copyright 1992-2015 Free Software Foundation, Inc. -timestamp='2013-06-10' +timestamp='2015-08-20' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -24,12 +24,12 @@ # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # -# Originally written by Per Bothner. +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to <config-patches@gnu.org>. me=`echo "$0" | sed -e 's,.*/,,'` @@ -50,7 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2013 Free Software Foundation, Inc. +Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -149,7 +149,7 @@ LIBC=gnu #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac @@ -168,20 +168,27 @@ # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || \ + echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) + arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ @@ -197,6 +204,13 @@ os=netbsd ;; esac + # Determine ABI tags. + case "${UNAME_MACHINE_ARCH}" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + ;; + esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need @@ -207,13 +221,13 @@ release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" + echo "${machine}-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` @@ -235,6 +249,9 @@ *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -579,8 +596,9 @@ else IBM_ARCH=powerpc fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi @@ -826,7 +844,7 @@ *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; - i*:MSYS*:*) + *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) @@ -932,6 +950,9 @@ crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; + e2k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; @@ -969,10 +990,10 @@ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; - or1k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} exit ;; - or32:Linux:*:*) + or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) @@ -1020,7 +1041,7 @@ echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} @@ -1260,16 +1281,26 @@ if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin
View file
libde265-1.0.2.tar.gz/config.h.in -> libde265-1.0.3.tar.gz/config.h.in
Changed
@@ -21,6 +21,9 @@ /* Support ARM instructions */ #undef HAVE_ARM +/* Define to 1 if you have the <cstdint> header file. */ +#undef HAVE_CSTDINT + /* define if the compiler supports basic C++11 syntax */ #undef HAVE_CXX11 @@ -132,10 +135,15 @@ /* Define to 1 if you have the `__mingw_aligned_malloc' function. */ #undef HAVE___MINGW_ALIGNED_MALLOC -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ +/* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR +/* Define to 1 if a fallback for "nullptr" is required. */ +#undef NEED_NULLPTR_FALLBACK + +/* Define to 1 if a fallback for "std::move" is required. */ +#undef NEED_STD_MOVE_FALLBACK + /* Name of package */ #undef PACKAGE @@ -171,6 +179,10 @@ /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ #undef TIME_WITH_SYS_TIME +/* Define to 1 if the std::tr1 namespace should be included in the std + namespace. */ +#undef USE_STD_TR1_NAMESPACE + /* Version number of package */ #undef VERSION
View file
libde265-1.0.2.tar.gz/config.sub -> libde265-1.0.3.tar.gz/config.sub
Changed
@@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2013 Free Software Foundation, Inc. +# Copyright 1992-2015 Free Software Foundation, Inc. -timestamp='2013-08-10' +timestamp='2015-08-20' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -25,7 +25,7 @@ # of the GNU General Public License, version 3 ("GPLv3"). -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to <config-patches@gnu.org>. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -68,7 +68,7 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2013 Free Software Foundation, Inc. +Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -117,7 +117,7 @@ case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os @@ -255,16 +255,18 @@ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ + | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ @@ -282,8 +284,10 @@ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ @@ -295,14 +299,14 @@ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ - | open8 \ - | or1k | or32 \ + | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ + | riscv32 | riscv64 \ | rl78 | rx \ | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -310,6 +314,7 @@ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -324,7 +329,10 @@ c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -369,18 +377,20 @@ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ + | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ @@ -400,8 +410,10 @@ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ @@ -413,16 +425,18 @@ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ + | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ + | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ @@ -430,6 +444,7 @@ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ + | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -506,6 +521,9 @@ basic_machine=i386-pc os=-aros ;; + asmjs) + basic_machine=asmjs-unknown + ;; aux) basic_machine=m68k-apple os=-aux @@ -767,6 +785,9 @@ basic_machine=m68k-isi os=-sysv ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; m68knommu) basic_machine=m68k-unknown os=-linux @@ -822,6 +843,10 @@ basic_machine=powerpc-unknown os=-morphos ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; msdos) basic_machine=i386-pc os=-msdos
View file
libde265-1.0.2.tar.gz/configure -> libde265-1.0.3.tar.gz/configure
Changed
@@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libde265 1.0.2. +# Generated by GNU Autoconf 2.69 for libde265 1.0.3. # # Report bugs to <farin@struktur.de>. # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='libde265' PACKAGE_TARNAME='libde265' -PACKAGE_VERSION='1.0.2' -PACKAGE_STRING='libde265 1.0.2' +PACKAGE_VERSION='1.0.3' +PACKAGE_STRING='libde265 1.0.3' PACKAGE_BUGREPORT='farin@struktur.de' PACKAGE_URL='' @@ -723,6 +723,7 @@ CCASFLAGS CCAS CPP +LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO @@ -788,6 +789,7 @@ docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -814,6 +816,7 @@ enable_static with_pic enable_fast_install +with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock @@ -837,6 +840,7 @@ LDFLAGS LIBS CPPFLAGS +LT_SYS_LIBRARY_PATH CPP CCAS CCASFLAGS @@ -893,6 +897,7 @@ sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1145,6 +1150,15 @@ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1282,7 +1296,7 @@ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1395,7 +1409,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.2 to adapt to many kinds of systems. +\`configure' configures libde265 1.0.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1435,6 +1449,7 @@ --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1466,7 +1481,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libde265 1.0.2:";; + short | recursive ) echo "Configuration of libde265 1.0.3:";; esac cat <<\_ACEOF @@ -1500,9 +1515,12 @@ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] + --with-aix-soname=aix|svr4|both + shared library versioning (aka "SONAME") variant to + provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-sysroot=DIR Search for dependent libraries within DIR - (or the compiler's sysroot if not specified). + --with-sysroot[=DIR] Search for dependent libraries within DIR (or the + compiler's sysroot if not specified). Some influential environment variables: CC C compiler command @@ -1512,6 +1530,8 @@ LIBS libraries to pass to the linker, e.g. -l<library> CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> + LT_SYS_LIBRARY_PATH + User-defined run-time library search path. CPP C preprocessor CCAS assembler compiler command (defaults to CC) CCASFLAGS assembler compiler flags (defaults to CFLAGS) @@ -1602,7 +1622,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libde265 configure 1.0.2 +libde265 configure 1.0.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2089,6 +2109,97 @@ } # ac_fn_c_check_header_mongrel +# ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES +# --------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_cxx_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #((
View file
libde265-1.0.2.tar.gz/configure.ac -> libde265-1.0.3.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.2], [farin@struktur.de]) +AC_INIT([libde265], [1.0.3], [farin@struktur.de]) AC_CONFIG_SRCDIR([libde265/de265.cc]) AC_CONFIG_HEADERS([config.h]) -NUMERIC_VERSION=0x01000200 # Numeric representation of the version (A.B.C[.D] = 0xAABBCCDD) +NUMERIC_VERSION=0x01000300 # Numeric representation of the version (A.B.C[.D] = 0xAABBCCDD) AC_SUBST(NUMERIC_VERSION) LIBDE265_CURRENT=0 @@ -36,8 +36,8 @@ # Initialize automake stuff AM_INIT_AUTOMAKE -CFLAGS+=" -std=c99" -CXXFLAGS+=" -Werror=return-type -Werror=unused-result -Werror=reorder" +CFLAGS="$CFLAGS -std=c99" +CXXFLAGS="$CXXFLAGS -Werror=return-type -Werror=unused-result -Werror=reorder" AX_CXX_COMPILE_STDCXX_11() dnl Use -Wall if we have gcc. @@ -58,6 +58,13 @@ # Checks for header files. AC_CHECK_HEADERS([stdint.h stdlib.h string.h malloc.h signal.h setjmp.h stddef.h sys/time.h]) +AC_LANG_PUSH(C++) +OLD_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CXXFLAGS" +AC_CHECK_HEADERS([cstdint]) +CPPFLAGS="$OLD_CPPFLAGS" +AC_LANG_POP(C++) + # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_TYPE_SIZE_T @@ -101,11 +108,66 @@ ],[],[need_strict_ansi=no],[need_strict_ansi=yes]); AC_LANG_POP(C++) if eval "test x$need_strict_ansi = xyes"; then - CFLAGS+=" -D__STRICT_ANSI__" - CXXFLAGS+=" -D__STRICT_ANSI__" + CFLAGS="$CFLAGS -D__STRICT_ANSI__" + CXXFLAGS="$CXXFLAGS -D__STRICT_ANSI__" fi AC_MSG_RESULT([$need_strict_ansi]) +# Check if "std::shared_ptr" is "std::tr1::shared_ptr" +AC_MSG_CHECKING([for std::shared_ptr]) +AC_LANG_PUSH(C++) +AC_TRY_COMPILE([ +#include <memory> +],[ +class A {}; +std::shared_ptr<A> a; +],[has_std_shared_ptr=yes],[has_std_shared_ptr=no]); +AC_MSG_RESULT([$has_std_shared_ptr]) +if eval "test x$has_std_shared_ptr = xno"; then + AC_MSG_CHECKING([for std::tr1::shared_ptr]) + AC_TRY_COMPILE([ + #include <tr1/memory> + ],[ + class A {}; + std::tr1::shared_ptr<A> a; + ],[has_std_tr1_shared_ptr=yes],[has_std_tr1_shared_ptr=no]); + AC_MSG_RESULT([$has_std_tr1_shared_ptr]) + if eval "test x$has_std_tr1_shared_ptr = xyes"; then + AC_DEFINE(USE_STD_TR1_NAMESPACE,1,[Define to 1 if the std::tr1 namespace should be included in the std namespace.]) + fi +fi +AC_LANG_POP(C++) + +# Check if "std::move" is available +AC_MSG_CHECKING([for std::move]) +AC_LANG_PUSH(C++) +AC_TRY_COMPILE([ +#include <utility> +],[ +class A {}; +A* a = new A(); +A* b = std::move(a); +],[has_std_move=yes],[has_std_move=no]); +AC_LANG_POP(C++) +if eval "test x$has_std_move = xno"; then + AC_DEFINE(NEED_STD_MOVE_FALLBACK,1,[Define to 1 if a fallback for "std::move" is required.]) +fi +AC_MSG_RESULT([$has_std_move]) + +# Check if "nullptr" is available +AC_MSG_CHECKING([for nullptr]) +AC_LANG_PUSH(C++) +AC_TRY_COMPILE([ +],[ +class A {}; +A* a = nullptr; +],[has_nullptr=yes],[has_nullptr=no]); +AC_LANG_POP(C++) +if eval "test x$has_nullptr = xno"; then + AC_DEFINE(NEED_NULLPTR_FALLBACK,1,[Define to 1 if a fallback for "nullptr" is required.]) +fi +AC_MSG_RESULT([$has_nullptr]) + # --- machine dependent optimizations --- #AX_EXT @@ -180,7 +242,7 @@ [enable_log_error=$enableval], [enable_log_error=yes]) if eval "test $enable_log_error = yes"; then - CXXFLAGS+=" -DDE265_LOG_ERROR" + CXXFLAGS="$CXXFLAGS -DDE265_LOG_ERROR" fi AC_ARG_ENABLE(log-info, @@ -189,7 +251,7 @@ [enable_log_info=$enableval], [enable_log_info=no]) if eval "test $enable_log_info = yes"; then - CXXFLAGS+=" -DDE265_LOG_INFO" + CXXFLAGS="$CXXFLAGS -DDE265_LOG_INFO" fi AC_ARG_ENABLE(log-debug, @@ -198,7 +260,7 @@ [enable_log_debug=$enableval], [enable_log_debug=no]) if eval "test $enable_log_debug = yes"; then - CXXFLAGS+=" -DDE265_LOG_DEBUG" + CXXFLAGS="$CXXFLAGS -DDE265_LOG_DEBUG" fi AC_ARG_ENABLE(log-trace, @@ -207,7 +269,7 @@ [enable_log_trace=$enableval], [enable_log_trace=no]) if eval "test $enable_log_trace = yes"; then - CXXFLAGS+=" -DDE265_LOG_TRACE" + CXXFLAGS="$CXXFLAGS -DDE265_LOG_TRACE" fi @@ -306,5 +368,6 @@ AC_CONFIG_FILES([enc265/Makefile]) AC_CONFIG_FILES([sherlock265/Makefile]) AC_CONFIG_FILES([tools/Makefile]) +AC_CONFIG_FILES([acceleration-speed/Makefile]) AC_CONFIG_FILES([libde265.pc]) AC_OUTPUT
View file
libde265-1.0.2.tar.gz/dec265/Makefile.in -> libde265-1.0.3.tar.gz/dec265/Makefile.in
Changed
@@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -15,7 +15,17 @@ @SET_MAKE@ VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -87,8 +97,6 @@ @HAVE_SDL_TRUE@am__append_5 = sdl.cc sdl.hh @MINGW_TRUE@am__append_6 = -static-libgcc -static-libstdc++ subdir = dec265 -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/depcomp COPYING ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ @@ -99,6 +107,7 @@ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -199,6 +208,7 @@ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp COPYING DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ @@ -251,6 +261,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -333,6 +344,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -378,7 +390,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu dec265/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu dec265/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -738,6 +749,8 @@ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS +.PRECIOUS: Makefile + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded.
View file
libde265-1.0.2.tar.gz/dec265/dec265.cc -> libde265-1.0.3.tar.gz/dec265/dec265.cc
Changed
@@ -113,6 +113,7 @@ for (int c=0;c<3;c++) { int stride; const uint8_t* p = de265_get_image_plane(img, c, &stride); + int width = de265_get_image_width(img,c); if (de265_get_bits_per_pixel(img,c)<=8) { @@ -125,12 +126,15 @@ else { // --- save 16 bit YUV --- + int bpp = (de265_get_bits_per_pixel(img,c)+7)/8; + int pixelsPerLine = stride/bpp; + uint8_t* buf = new uint8_t[width*2]; uint16_t* p16 = (uint16_t*)p; for (int y=0;y<de265_get_image_height(img,c);y++) { for (int x=0;x<width;x++) { - uint16_t pixel_value = (p16+y*stride)[x]; + uint16_t pixel_value = (p16+y*pixelsPerLine)[x]; buf[2*x+0] = pixel_value & 0xFF; buf[2*x+1] = pixel_value >> 8; } @@ -217,14 +221,15 @@ } #endif -static uint8_t* convert_to_8bit(const uint8_t* data, int width, int height, int stride, int bit_depth) +static uint8_t* convert_to_8bit(const uint8_t* data, int width, int height, + int pixelsPerLine, int bit_depth) { const uint16_t* data16 = (const uint16_t*)data; - uint8_t* out = new uint8_t[stride*height]; + uint8_t* out = new uint8_t[pixelsPerLine*height]; for (int y=0;y<height;y++) { for (int x=0;x<width;x++) { - out[y*stride + x] = *(data16 + y*stride +x) >> (bit_depth-8); + out[y*pixelsPerLine + x] = *(data16 + y*pixelsPerLine +x) >> (bit_depth-8); } } @@ -264,25 +269,30 @@ const uint8_t* cb =de265_get_image_plane(img,1,&chroma_stride); const uint8_t* cr =de265_get_image_plane(img,2,NULL); + int bpp_y = (de265_get_bits_per_pixel(img,0)+7)/8; + int bpp_c = (de265_get_bits_per_pixel(img,1)+7)/8; + int ppl_y = stride/bpp_y; + int ppl_c = chroma_stride/bpp_c; + uint8_t* y16 = NULL; uint8_t* cb16 = NULL; uint8_t* cr16 = NULL; int bd; if ((bd=de265_get_bits_per_pixel(img, 0)) > 8) { - y16 = convert_to_8bit(y, width,height,stride,bd); y=y16; + y16 = convert_to_8bit(y, width,height,ppl_y,bd); y=y16; } if (chroma != de265_chroma_mono) { if ((bd=de265_get_bits_per_pixel(img, 1)) > 8) { - cb16 = convert_to_8bit(cb, chroma_width,chroma_height,chroma_stride,bd); cb=cb16; + cb16 = convert_to_8bit(cb, chroma_width,chroma_height,ppl_c,bd); cb=cb16; } if ((bd=de265_get_bits_per_pixel(img, 2)) > 8) { - cr16 = convert_to_8bit(cr, chroma_width,chroma_height,chroma_stride,bd); cr=cr16; + cr16 = convert_to_8bit(cr, chroma_width,chroma_height,ppl_c,bd); cr=cr16; } } - sdlWin.display(y,cb,cr, stride, chroma_stride); + sdlWin.display(y,cb,cr, ppl_y, ppl_c); delete[] y16; delete[] cb16;
View file
libde265-1.0.2.tar.gz/depcomp -> libde265-1.0.3.tar.gz/depcomp
Changed
@@ -3,7 +3,7 @@ scriptversion=2013-05-30.07; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by
View file
libde265-1.0.2.tar.gz/enc265/CMakeLists.txt -> libde265-1.0.3.tar.gz/enc265/CMakeLists.txt
Changed
@@ -1,5 +1,6 @@ set (enc265_sources enc265.cc + image-io-png.cc ) if(MSVC)
View file
libde265-1.0.2.tar.gz/enc265/Makefile.am -> libde265-1.0.3.tar.gz/enc265/Makefile.am
Changed
@@ -7,7 +7,7 @@ enc265_CXXFLAGS = enc265_LDFLAGS = enc265_LDADD = ../libde265/libde265.la -lstdc++ -enc265_SOURCES = enc265.cc +enc265_SOURCES = enc265.cc image-io-png.cc image-io-png.h if HAVE_VIDEOGFX enc265_CXXFLAGS += $(VIDEOGFX_CFLAGS)
View file
libde265-1.0.2.tar.gz/enc265/Makefile.in -> libde265-1.0.3.tar.gz/enc265/Makefile.in
Changed
@@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -15,7 +15,17 @@ @SET_MAKE@ VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -83,8 +93,6 @@ @HAVE_VIDEOGFX_TRUE@am__append_1 = $(VIDEOGFX_CFLAGS) @HAVE_VIDEOGFX_TRUE@am__append_2 = $(VIDEOGFX_LIBS) subdir = enc265 -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ @@ -95,13 +103,15 @@ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) -am_enc265_OBJECTS = enc265-enc265.$(OBJEXT) +am_enc265_OBJECTS = enc265-enc265.$(OBJEXT) \ + enc265-image-io-png.$(OBJEXT) enc265_OBJECTS = $(am_enc265_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -144,6 +154,24 @@ am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(enc265_SOURCES) DIST_SOURCES = $(enc265_SOURCES) am__can_run_installinfo = \ @@ -170,6 +198,7 @@ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ @@ -222,6 +251,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -304,6 +334,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -321,7 +352,7 @@ enc265_CXXFLAGS = $(am__append_1) enc265_LDFLAGS = $(am__append_2) enc265_LDADD = ../libde265/libde265.la -lstdc++ -enc265_SOURCES = enc265.cc +enc265_SOURCES = enc265.cc image-io-png.cc image-io-png.h EXTRA_DIST = \ CMakeLists.txt \ Makefile.vc7 @@ -342,7 +373,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu enc265/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu enc265/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -421,6 +451,7 @@ -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc265-enc265.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc265-image-io-png.Po@am__quote@ .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -457,6 +488,20 @@ @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) $(enc265_CXXFLAGS) $(CXXFLAGS) -c -o enc265-enc265.obj `if test -f 'enc265.cc'; then $(CYGPATH_W) 'enc265.cc'; else $(CYGPATH_W) '$(srcdir)/enc265.cc'; fi` +enc265-image-io-png.o: image-io-png.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enc265_CXXFLAGS) $(CXXFLAGS) -MT enc265-image-io-png.o -MD -MP -MF $(DEPDIR)/enc265-image-io-png.Tpo -c -o enc265-image-io-png.o `test -f 'image-io-png.cc' || echo '$(srcdir)/'`image-io-png.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enc265-image-io-png.Tpo $(DEPDIR)/enc265-image-io-png.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='image-io-png.cc' object='enc265-image-io-png.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) $(enc265_CXXFLAGS) $(CXXFLAGS) -c -o enc265-image-io-png.o `test -f 'image-io-png.cc' || echo '$(srcdir)/'`image-io-png.cc + +enc265-image-io-png.obj: image-io-png.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enc265_CXXFLAGS) $(CXXFLAGS) -MT enc265-image-io-png.obj -MD -MP -MF $(DEPDIR)/enc265-image-io-png.Tpo -c -o enc265-image-io-png.obj `if test -f 'image-io-png.cc'; then $(CYGPATH_W) 'image-io-png.cc'; else $(CYGPATH_W) '$(srcdir)/image-io-png.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enc265-image-io-png.Tpo $(DEPDIR)/enc265-image-io-png.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='image-io-png.cc' object='enc265-image-io-png.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) $(enc265_CXXFLAGS) $(CXXFLAGS) -c -o enc265-image-io-png.obj `if test -f 'image-io-png.cc'; then $(CYGPATH_W) 'image-io-png.cc'; else $(CYGPATH_W) '$(srcdir)/image-io-png.cc'; fi` + mostlyclean-libtool: -rm -f *.lo @@ -668,6 +713,8 @@ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS +.PRECIOUS: Makefile + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded.
View file
libde265-1.0.2.tar.gz/enc265/enc265.cc -> libde265-1.0.3.tar.gz/enc265/enc265.cc
Changed
@@ -18,12 +18,16 @@ * along with libde265. If not, see <http://www.gnu.org/licenses/>. */ -#include "libde265/en265.h" //coder-context.h" +#include "libde265/en265.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "libde265/configparam.h" #include "libde265/image-io.h" -#include "libde265/encoder/analyze.h" +#include "libde265/encoder/encoder-core.h" #include "libde265/util.h" +#include "image-io-png.h" #include <getopt.h> @@ -85,6 +89,8 @@ option_int input_width; option_int input_height; + option_bool input_is_rgb; + // output option_string output_filename; @@ -123,6 +129,10 @@ input_height.set_ID("height"); input_height.set_short_option('h'); input_height.set_minimum(1); input_height.set_default(288); + + input_is_rgb.set_ID("rgb"); + input_is_rgb.set_default(false); + input_is_rgb.set_description("input is sequence of RGB PNG images"); } @@ -134,6 +144,11 @@ config.add_option(&max_number_of_frames); config.add_option(&input_width); config.add_option(&input_height); +#if HAVE_VIDEOGFX + if (videogfx::PNG_Supported()) { + config.add_option(&input_is_rgb); + } +#endif } @@ -175,6 +190,9 @@ extern int skipTBSplit, noskipTBSplit; extern int zeroBlockCorrelation[6][2][5]; +/*LIBDE265_API*/ ImageSink_YUV reconstruction_sink; + + int main(int argc, char** argv) { de265_init(); @@ -224,7 +242,7 @@ fprintf(stderr," enc265 v%s\n", de265_get_version()); fprintf(stderr,"--------------\n"); fprintf(stderr,"usage: enc265 [options]\n"); - fprintf(stderr,"The video file must be a raw YUV file\n"); + fprintf(stderr,"The video file must be a raw YUV file or a PNG sequence for RGB input\n"); fprintf(stderr,"\n"); fprintf(stderr,"options:\n"); fprintf(stderr," --help show help\n"); @@ -240,6 +258,7 @@ de265_set_verbosity(verbosity); + #if HAVE_VIDEOGFX //debug_set_image_output(debug_show_image_libvideogfx); #endif @@ -247,16 +266,31 @@ //test_parameters_API(ectx); - ImageSink_YUV reconstruction_sink; if (strlen(inout_params.reconstruction_yuv.get().c_str()) != 0) { reconstruction_sink.set_filename(inout_params.reconstruction_yuv.get().c_str()); //ectx.reconstruction_sink = &reconstruction_sink; } - ImageSource_YUV image_source; - image_source.set_input_file(inout_params.input_yuv.get().c_str(), - inout_params.input_width, - inout_params.input_height); + ImageSource* image_source; + ImageSource_YUV image_source_yuv; +#if HAVE_VIDEOGFX + ImageSource_PNG image_source_png; +#endif + + + if (inout_params.input_is_rgb) { +#if HAVE_VIDEOGFX + image_source_png.set_input_file(inout_params.input_yuv.get().c_str()); + image_source = &image_source_png; +#endif + } + else { + image_source_yuv.set_input_file(inout_params.input_yuv.get().c_str(), + inout_params.input_width, + inout_params.input_height); + image_source = &image_source_yuv; + } + PacketSink_File packet_sink; packet_sink.set_filename(inout_params.output_filename.get().c_str()); @@ -264,7 +298,7 @@ // --- run encoder --- - image_source.skip_frames( inout_params.first_frame ); + image_source->skip_frames( inout_params.first_frame ); en265_start_encoder(ectx, 0); @@ -278,7 +312,7 @@ { // push one image into the encoder - de265_image* input_image = image_source.get_image(); + de265_image* input_image = image_source->get_image(); if (input_image==NULL) { en265_push_eof(ectx); eof=true; @@ -308,7 +342,6 @@ } - // --- print statistics --- en265_print_logging((encoder_context*)ectx, "tb-split", NULL);
View file
libde265-1.0.3.tar.gz/enc265/image-io-png.cc
Added
@@ -0,0 +1,110 @@ +/* + * H.265 video codec. + * Copyright (c) 2013-2014 struktur AG, Dirk Farin <farin@struktur.de> + * + * Authors: struktur AG, Dirk Farin <farin@struktur.de> + * + * This file is part of libde265. + * + * libde265 is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * libde265 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with libde265. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "image-io-png.h" +#include <assert.h> + +#if HAVE_VIDEOGFX +#include <libvideogfx.hh> +using namespace videogfx; + + +ImageSource_PNG::ImageSource_PNG() +{ + mFilenameTemplate = NULL; + mNextImageNumber = 1; + + mReachedEndOfStream = false; + + mWidth=mHeight=0; +} + +ImageSource_PNG::~ImageSource_PNG() +{ +} + +bool ImageSource_PNG::set_input_file(const char* filename) +{ + mFilenameTemplate = filename; + return true; +} + +de265_image* ImageSource_PNG::get_image(bool block) +{ + if (mReachedEndOfStream) return NULL; + + + // --- construct image filename --- + + char filename[1000]; + sprintf(filename,mFilenameTemplate,mNextImageNumber); + mNextImageNumber++; + + + // --- load image --- + + Image<Pixel> input; + bool success = videogfx::ReadImage_PNG(input, filename); + if (!success) { + mReachedEndOfStream = true; + return NULL; + } + + + mWidth = input.AskWidth(); + mHeight= input.AskHeight(); + + de265_image* img = new de265_image; + img->alloc_image(mWidth,mHeight,de265_chroma_444, NULL, false, + NULL, NULL, 0, NULL, false); + assert(img); // TODO: error handling + + + uint8_t* p; + int stride; + + for (int c=0;c<3;c++) { + int h265channel; + switch (c) { + case 0: h265channel=2; break; // R + case 1: h265channel=0; break; // G + case 2: h265channel=1; break; // B + } + + p = img->get_image_plane(h265channel); + stride = img->get_image_stride(h265channel); + + for (int y=0;y<mHeight;y++) { + memcpy(p, input.AskFrame((BitmapChannel(c)))[y], mWidth); + p += stride; + } + } + + return img; +} + +void ImageSource_PNG::skip_frames(int n) +{ + mNextImageNumber += n; +} + +#endif
View file
libde265-1.0.3.tar.gz/enc265/image-io-png.h
Added
@@ -0,0 +1,56 @@ +/* + * H.265 video codec. + * Copyright (c) 2013-2014 struktur AG, Dirk Farin <farin@struktur.de> + * + * Authors: struktur AG, Dirk Farin <farin@struktur.de> + * + * This file is part of libde265. + * + * libde265 is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * libde265 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with libde265. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef IMAGE_IO_PNG_H +#define IMAGE_IO_PNG_H + +#include "libde265/image-io.h" +#include <deque> + + +#if HAVE_VIDEOGFX +class ImageSource_PNG : public ImageSource +{ + public: + LIBDE265_API ImageSource_PNG(); + virtual LIBDE265_API ~ImageSource_PNG(); + + bool LIBDE265_API set_input_file(const char* filename); + + //virtual ImageStatus get_status(); + virtual LIBDE265_API de265_image* get_image(bool block=true); + virtual LIBDE265_API void skip_frames(int n); + + virtual LIBDE265_API int get_width() const { return mWidth; } + virtual LIBDE265_API int get_height() const { return mHeight; } + + private: + const char* mFilenameTemplate; + int mNextImageNumber; + + bool mReachedEndOfStream; + + int mWidth,mHeight; +}; +#endif + +#endif
View file
libde265-1.0.2.tar.gz/install-sh -> libde265-1.0.3.tar.gz/install-sh
Changed
@@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-11-20.07; # UTC +scriptversion=2014-09-12.12; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -41,19 +41,15 @@ # This script is compatible with the BSD install script, but was written # from scratch. +tab=' ' nl=' ' -IFS=" "" $nl" +IFS=" $tab$nl" -# set DOITPROG to echo to test this script +# Set DOITPROG to "echo" to test this script. -# Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi +doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. @@ -68,17 +64,6 @@ rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - posix_mkdir= # Desired mode of installed file. @@ -97,7 +82,7 @@ dst_arg= copy_on_change=false -no_target_directory= +is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE @@ -137,46 +122,57 @@ -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" - shift;; + shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; -o) chowncmd="$chownprog $2" - shift;; + shift;; -s) stripcmd=$stripprog;; - -t) dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - shift;; + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; - -T) no_target_directory=true;; + -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; - --) shift - break;; + --) shift + break;; - -*) echo "$0: invalid option: $1" >&2 - exit 1;; + -*) echo "$0: invalid option: $1" >&2 + exit 1;; *) break;; esac shift done +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. @@ -208,6 +204,15 @@ fi if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 @@ -223,16 +228,16 @@ *[0-7]) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw='% 200' + u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw=,u+rw + u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac @@ -269,41 +274,15 @@ # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/
View file
libde265-1.0.3.tar.gz/libde265-1.0.2
Added
+(directory)
View file
libde265-1.0.3.tar.gz/libde265-1.0.2/COPYING
Added
@@ -0,0 +1,853 @@ +The library `libde265` is distributed under the terms of the GNU Lesser +General Public License. The sample applications are distributed under +the terms of the GNU General Public License. + +License texts below and in the `COPYING` files of the corresponding +subfolders. + +---------------------------------------------------------------------- + + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. + +---------------------------------------------------------------------- + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not
View file
libde265-1.0.2.tar.gz/libde265/CMakeLists.txt -> libde265-1.0.3.tar.gz/libde265/CMakeLists.txt
Changed
@@ -65,20 +65,16 @@ add_definitions(-DLIBDE265_EXPORTS) -add_library(${LIBDE265_LIBRARY_NAME} SHARED ${libde265_sources}) - -target_link_libraries(${LIBDE265_LIBRARY_NAME} ${CMAKE_THREAD_LIBS_INIT}) - -if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") - SET_TARGET_PROPERTIES(${LIBDE265_LIBRARY_NAME} PROPERTIES COMPILE_FLAGS "-fPIC") -endif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") - add_subdirectory (encoder) -target_link_libraries(${LIBDE265_LIBRARY_NAME} encoder) - if(SUPPORTS_SSE4_1) add_definitions(-DHAVE_SSE4_1) add_subdirectory (x86) - target_link_libraries(${LIBDE265_LIBRARY_NAME} x86) endif() + +add_library(${LIBDE265_LIBRARY_NAME} SHARED ${libde265_sources} ${ENCODER_OBJECTS} ${X86_OBJECTS}) +target_link_libraries(${LIBDE265_LIBRARY_NAME} ${CMAKE_THREAD_LIBS_INIT}) + +if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + SET_TARGET_PROPERTIES(${LIBDE265_LIBRARY_NAME} PROPERTIES COMPILE_FLAGS "-fPIC") +endif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
View file
libde265-1.0.2.tar.gz/libde265/Makefile.am -> libde265-1.0.3.tar.gz/libde265/Makefile.am
Changed
@@ -19,7 +19,6 @@ endif libde265_la_LDFLAGS = -version-info $(LIBDE265_CURRENT):$(LIBDE265_REVISION):$(LIBDE265_AGE) -libde265_la_LIBADD = -lstdc++ libde265_la_SOURCES = \ acceleration.h \ @@ -92,7 +91,7 @@ vui.h SUBDIRS = encoder -libde265_la_LIBADD += encoder/libde265_encoder.la +libde265_la_LIBADD = encoder/libde265_encoder.la if ENABLE_SSE_OPT SUBDIRS += x86
View file
libde265-1.0.2.tar.gz/libde265/Makefile.in -> libde265-1.0.3.tar.gz/libde265/Makefile.in
Changed
@@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -16,7 +16,17 @@ VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -89,9 +99,6 @@ @MINGW_TRUE@am__append_7 = ../extra/win32cond.c ../extra/win32cond.h @MINGW_TRUE@am__append_8 = -no-undefined -static-libgcc -static-libstdc++ subdir = libde265 -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(srcdir)/de265-version.h.in $(top_srcdir)/depcomp \ - $(libde265_la_HEADERS) COPYING ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ @@ -102,6 +109,8 @@ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(libde265_la_HEADERS) \ + $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = de265-version.h @@ -273,6 +282,8 @@ ETAGS = etags CTAGS = ctags DIST_SUBDIRS = encoder x86 arm +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/de265-version.h.in \ + $(top_srcdir)/depcomp COPYING DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ @@ -350,6 +361,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -432,6 +444,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -457,8 +470,6 @@ libde265_la_LDFLAGS = -version-info \ $(LIBDE265_CURRENT):$(LIBDE265_REVISION):$(LIBDE265_AGE) \ $(am__append_8) -libde265_la_LIBADD = -lstdc++ encoder/libde265_encoder.la \ - $(am__append_4) $(am__append_6) libde265_la_SOURCES = acceleration.h alloc_pool.h alloc_pool.cc \ bitstream.cc bitstream.h cabac.cc cabac.h configparam.cc \ configparam.h contextmodel.cc contextmodel.h de265.cc \ @@ -473,6 +484,8 @@ transform.h util.cc util.h visualize.cc visualize.h vps.cc \ vps.h vui.cc vui.h $(am__append_7) SUBDIRS = encoder $(am__append_3) $(am__append_5) +libde265_la_LIBADD = encoder/libde265_encoder.la $(am__append_4) \ + $(am__append_6) EXTRA_DIST = Makefile.vc7 \ CMakeLists.txt \ ../extra/stdbool.h \ @@ -498,7 +511,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libde265/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libde265/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -1214,6 +1226,8 @@ uninstall-am uninstall-libLTLIBRARIES \ uninstall-libde265_laHEADERS +.PRECIOUS: Makefile + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded.
View file
libde265-1.0.2.tar.gz/libde265/Makefile.vc7 -> libde265-1.0.3.tar.gz/libde265/Makefile.vc7
Changed
@@ -4,7 +4,7 @@ CFLAGS=/I..\extra /I.. /I. CC=cl /nologo LINK=link /nologo /subsystem:console -DEFINES=/DWIN32 /D_WIN32_WINNT=0x0400 /DNDEBUG /DLIBDE265_EXPORTS /D_CRT_SECURE_NO_WARNINGS /DHAVE_SSE4_1 /DNOMINMAX +DEFINES=/DWIN32 /D_WIN32_WINNT=0x0400 /DNDEBUG /DLIBDE265_EXPORTS /D_CRT_SECURE_NO_WARNINGS /DHAVE_SSE4_1 /DNOMINMAX /DHAVE_STDINT_H CFLAGS=$(CFLAGS) /MT /Ox /Ob2 /Oi /TP /W4 /GL /EHsc @@ -64,10 +64,11 @@ visualize.obj \ vps.obj \ vui.obj \ - encoder\analyze.obj \ - encoder\encode.obj \ + encoder\encoder-core.obj \ + encoder\encoder-types.obj \ encoder\encoder-context.obj \ encoder\encoder-params.obj \ + encoder\encoder-syntax.obj \ encoder\encpicbuf.obj \ encoder\sop.obj \ encoder\algo\algo.obj \ @@ -81,7 +82,9 @@ encoder\algo\ctb-qscale.obj \ encoder\algo\pb-mv.obj \ encoder\algo\tb-intrapredmode.obj \ + encoder\algo\tb-rateestim.obj \ encoder\algo\tb-split.obj \ + encoder\algo\tb-transform.obj \ x86\sse.obj \ x86\sse-dct.obj \ x86\sse-motion.obj \
View file
libde265-1.0.2.tar.gz/libde265/alloc_pool.h -> libde265-1.0.3.tar.gz/libde265/alloc_pool.h
Changed
@@ -23,11 +23,16 @@ #ifndef ALLOC_POOL_H #define ALLOC_POOL_H +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include <vector> #include <cstddef> #ifdef HAVE_STDINT_H #include <stdint.h> -#else +#endif +#ifdef HAVE_CSTDINT #include <cstdint> #endif
View file
libde265-1.0.2.tar.gz/libde265/arm/Makefile.in -> libde265-1.0.3.tar.gz/libde265/arm/Makefile.in
Changed
@@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -15,7 +15,17 @@ @SET_MAKE@ VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -84,8 +94,6 @@ @ENABLE_NEON_OPT_TRUE@am__append_1 = libde265_arm_neon.la @ENABLE_NEON_OPT_TRUE@am__append_2 = libde265_arm_neon.la subdir = libde265/arm -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ @@ -96,6 +104,7 @@ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -211,6 +220,7 @@ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ @@ -263,6 +273,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -345,6 +356,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -390,7 +402,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libde265/arm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libde265/arm/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -724,6 +735,8 @@ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am +.PRECIOUS: Makefile + @HAVE_VISIBILITY_TRUE@ libde265_arm_la_CXXFLAGS += -DHAVE_VISIBILITY
View file
libde265-1.0.2.tar.gz/libde265/configparam.cc -> libde265-1.0.3.tar.gz/libde265/configparam.cc
Changed
@@ -241,6 +241,8 @@ argv[i]+2)==0) { option_found=true; + printf("FOUND %s\n",argv[i]); + bool success = mOptions[o]->processCmdLineArguments(argv,argc, i+1); if (!success) { if (first_idx_ptr) { *first_idx_ptr = i; } @@ -346,6 +348,10 @@ sstr << ", default=" << o->get_default_string(); } + if (o->has_description()) { + sstr << " : " << o->get_description(); + } + sstr << "\n"; std::cerr << sstr.str(); @@ -399,7 +405,7 @@ choice_option_base* o = dynamic_cast<choice_option_base*>(option); assert(o); - + return o->get_choice_names(); }
View file
libde265-1.0.2.tar.gz/libde265/configparam.h -> libde265-1.0.3.tar.gz/libde265/configparam.h
Changed
@@ -63,6 +63,7 @@ void set_description(std::string descr) { mDescription = descr; } std::string get_description() const { return mDescription; } + bool has_description() const { return !mDescription.empty(); } // --- value --- @@ -130,8 +131,8 @@ void set_default(bool v) { default_value=v; default_set=true; } virtual std::string get_default_string() const { return default_value ? "true":"false"; } - virtual std::string getTypeDescr() const { return "boolean"; } - virtual LIBDE265_API bool processCmdLineArguments(char** argv, int* argc, int idx) { value=true; return true; } + virtual std::string getTypeDescr() const { return "(boolean)"; } + virtual LIBDE265_API bool processCmdLineArguments(char** argv, int* argc, int idx) { set(true); return true; } bool set(bool v) { value_set=true; value=v; return true; }
View file
libde265-1.0.2.tar.gz/libde265/contextmodel.cc -> libde265-1.0.3.tar.gz/libde265/contextmodel.cc
Changed
@@ -78,7 +78,7 @@ // if (*refcnt == 1) { return; } <- keep memory for later, but does not work when we believe that we freed the memory and nulled all references (*refcnt)--; - if (refcnt==0) { + if (*refcnt==0) { delete[] model; delete refcnt; }
View file
libde265-1.0.2.tar.gz/libde265/de265-version.h -> libde265-1.0.3.tar.gz/libde265/de265-version.h
Changed
@@ -28,9 +28,9 @@ #define LIBDE265_VERSION_H /* Numeric representation of the version */ -#define LIBDE265_NUMERIC_VERSION 0x01000200 +#define LIBDE265_NUMERIC_VERSION 0x01000300 /* Version string */ -#define LIBDE265_VERSION "1.0.2" +#define LIBDE265_VERSION "1.0.3" #endif
View file
libde265-1.0.2.tar.gz/libde265/de265.cc -> libde265-1.0.3.tar.gz/libde265/de265.cc
Changed
@@ -168,12 +168,12 @@ -ALIGNED_8(static de265_sync_int de265_init_count) = 0; +static std::atomic<int> de265_init_count; LIBDE265_API de265_error de265_init() { - int cnt = de265_sync_add_and_fetch(&de265_init_count,1); - if (cnt>1) { + int cnt = std::atomic_fetch_add(&de265_init_count,1); + if (cnt>0) { // we are not the first -> already initialized return DE265_OK; @@ -185,7 +185,7 @@ init_scan_orders(); if (!alloc_and_init_significant_coeff_ctxIdx_lookupTable()) { - de265_sync_sub_and_fetch(&de265_init_count,1); + std::atomic_fetch_sub(&de265_init_count,1); return DE265_ERROR_LIBRARY_INITIALIZATION_FAILED; } @@ -194,13 +194,13 @@ LIBDE265_API de265_error de265_free() { - int cnt = de265_sync_sub_and_fetch(&de265_init_count,1); - if (cnt<0) { - de265_sync_add_and_fetch(&de265_init_count,1); + int cnt = std::atomic_fetch_sub(&de265_init_count,1); + if (cnt<=0) { + std::atomic_fetch_add(&de265_init_count,1); return DE265_ERROR_LIBRARY_NOT_INITIALIZED; } - if (cnt==0) { + if (cnt==1) { free_significant_coeff_ctxIdx_lookupTable(); } @@ -620,10 +620,10 @@ { switch (channel) { case 0: - return img->sps.BitDepth_Y; + return img->get_sps().BitDepth_Y; case 1: case 2: - return img->sps.BitDepth_C; + return img->get_sps().BitDepth_C; default: return 0; }
View file
libde265-1.0.2.tar.gz/libde265/deblock.cc -> libde265-1.0.3.tar.gz/libde265/deblock.cc
Changed
@@ -129,23 +129,24 @@ bool derive_edgeFlags_CTBRow(de265_image* img, int ctby) { - const int minCbSize = img->sps.MinCbSizeY; - bool deblocking_enabled=false; // whether deblocking is enabled in some part of the image + const seq_parameter_set& sps = img->get_sps(); + const pic_parameter_set& pps = img->get_pps(); - int ctb_mask = (1<<img->sps.Log2CtbSizeY)-1; - int picWidthInCtbs = img->sps.PicWidthInCtbsY; - int ctbshift = img->sps.Log2CtbSizeY; + const int minCbSize = sps.MinCbSizeY; + bool deblocking_enabled=false; // whether deblocking is enabled in some part of the image - const pic_parameter_set* pps = &img->pps; + int ctb_mask = (1<<sps.Log2CtbSizeY)-1; + int picWidthInCtbs = sps.PicWidthInCtbsY; + int ctbshift = sps.Log2CtbSizeY; - int cb_y_start = ( ctby << img->sps.Log2CtbSizeY) >> img->sps.Log2MinCbSizeY; - int cb_y_end = ((ctby+1) << img->sps.Log2CtbSizeY) >> img->sps.Log2MinCbSizeY; + int cb_y_start = ( ctby << sps.Log2CtbSizeY) >> sps.Log2MinCbSizeY; + int cb_y_end = ((ctby+1) << sps.Log2CtbSizeY) >> sps.Log2MinCbSizeY; - cb_y_end = std::min(cb_y_end, img->sps.PicHeightInMinCbsY); + cb_y_end = std::min(cb_y_end, sps.PicHeightInMinCbsY); for (int cb_y=cb_y_start;cb_y<cb_y_end;cb_y++) - for (int cb_x=0;cb_x<img->sps.PicWidthInMinCbsY;cb_x++) + for (int cb_x=0;cb_x<img->get_sps().PicWidthInMinCbsY;cb_x++) { int log2CbSize = img->get_log2CbSize_cbUnits(cb_x,cb_y); if (log2CbSize==0) { @@ -185,9 +186,9 @@ { filterLeftCbEdge = 0; } - else if (pps->loop_filter_across_tiles_enabled_flag == 0 && - pps->TileIdRS[ x0ctb +y0ctb*picWidthInCtbs] != - pps->TileIdRS[((x0-1)>>ctbshift)+y0ctb*picWidthInCtbs]) { + else if (pps.loop_filter_across_tiles_enabled_flag == 0 && + pps.TileIdRS[ x0ctb +y0ctb*picWidthInCtbs] != + pps.TileIdRS[((x0-1)>>ctbshift)+y0ctb*picWidthInCtbs]) { filterLeftCbEdge = 0; } } @@ -199,9 +200,9 @@ { filterTopCbEdge = 0; } - else if (pps->loop_filter_across_tiles_enabled_flag == 0 && - pps->TileIdRS[x0ctb+ y0ctb *picWidthInCtbs] != - pps->TileIdRS[x0ctb+((y0-1)>>ctbshift)*picWidthInCtbs]) { + else if (pps.loop_filter_across_tiles_enabled_flag == 0 && + pps.TileIdRS[x0ctb+ y0ctb *picWidthInCtbs] != + pps.TileIdRS[x0ctb+((y0-1)>>ctbshift)*picWidthInCtbs]) { filterTopCbEdge = 0; } } @@ -228,7 +229,7 @@ { bool deblocking_enabled=false; - for (int y=0;y<img->sps.PicHeightInCtbsY;y++) { + for (int y=0;y<img->get_sps().PicHeightInCtbsY;y++) { deblocking_enabled |= derive_edgeFlags_CTBRow(img,y); } @@ -252,8 +253,8 @@ xEnd = libde265_min(xEnd,img->get_deblk_width()); yEnd = libde265_min(yEnd,img->get_deblk_height()); - int TUShift = img->sps.Log2MinTrafoSize; - int TUStride= img->sps.PicWidthInTbsY; + int TUShift = img->get_sps().Log2MinTrafoSize; + int TUStride= img->get_sps().PicWidthInTbsY; for (int y=yStart;y<yEnd;y+=yIncr) for (int x=xStart;x<xEnd;x+=xIncr) { @@ -288,16 +289,16 @@ bS = 0; - const MotionVectorSpec* mviP = img->get_mv_info(xDiOpp,yDiOpp); - const MotionVectorSpec* mviQ = img->get_mv_info(xDi ,yDi); + const PBMotion& mviP = img->get_mv_info(xDiOpp,yDiOpp); + const PBMotion& mviQ = img->get_mv_info(xDi ,yDi); slice_segment_header* shdrP = img->get_SliceHeader(xDiOpp,yDiOpp); slice_segment_header* shdrQ = img->get_SliceHeader(xDi ,yDi); - int refPicP0 = mviP->predFlag[0] ? shdrP->RefPicList[0][ mviP->refIdx[0] ] : -1; - int refPicP1 = mviP->predFlag[1] ? shdrP->RefPicList[1][ mviP->refIdx[1] ] : -1; - int refPicQ0 = mviQ->predFlag[0] ? shdrQ->RefPicList[0][ mviQ->refIdx[0] ] : -1; - int refPicQ1 = mviQ->predFlag[1] ? shdrQ->RefPicList[1][ mviQ->refIdx[1] ] : -1; + int refPicP0 = mviP.predFlag[0] ? shdrP->RefPicList[0][ mviP.refIdx[0] ] : -1; + int refPicP1 = mviP.predFlag[1] ? shdrP->RefPicList[1][ mviP.refIdx[1] ] : -1; + int refPicQ0 = mviQ.predFlag[0] ? shdrQ->RefPicList[0][ mviQ.refIdx[0] ] : -1; + int refPicQ1 = mviQ.predFlag[1] ? shdrQ->RefPicList[1][ mviQ.refIdx[1] ] : -1; bool samePics = ((refPicP0==refPicQ0 && refPicP1==refPicQ1) || (refPicP0==refPicQ1 && refPicP1==refPicQ0)); @@ -306,13 +307,13 @@ bS = 1; } else { - MotionVector mvP0 = mviP->mv[0]; if (!mviP->predFlag[0]) { mvP0.x=mvP0.y=0; } - MotionVector mvP1 = mviP->mv[1]; if (!mviP->predFlag[1]) { mvP1.x=mvP1.y=0; } - MotionVector mvQ0 = mviQ->mv[0]; if (!mviQ->predFlag[0]) { mvQ0.x=mvQ0.y=0; } - MotionVector mvQ1 = mviQ->mv[1]; if (!mviQ->predFlag[1]) { mvQ1.x=mvQ1.y=0; } + MotionVector mvP0 = mviP.mv[0]; if (!mviP.predFlag[0]) { mvP0.x=mvP0.y=0; } + MotionVector mvP1 = mviP.mv[1]; if (!mviP.predFlag[1]) { mvP1.x=mvP1.y=0; } + MotionVector mvQ0 = mviQ.mv[0]; if (!mviQ.predFlag[0]) { mvQ0.x=mvQ0.y=0; } + MotionVector mvQ1 = mviQ.mv[1]; if (!mviQ.predFlag[1]) { mvQ1.x=mvQ1.y=0; } - int numMV_P = mviP->predFlag[0] + mviP->predFlag[1]; - int numMV_Q = mviQ->predFlag[0] + mviQ->predFlag[1]; + int numMV_P = mviP.predFlag[0] + mviP.predFlag[1]; + int numMV_Q = mviQ.predFlag[0] + mviQ.predFlag[1]; if (numMV_P!=numMV_Q) { img->decctx->add_warning(DE265_WARNING_NUMMVP_NOT_EQUAL_TO_NUMMVQ, false); @@ -376,7 +377,7 @@ void derive_boundaryStrength_CTB(de265_image* img, bool vertical, int xCtb,int yCtb) { - int ctbSize = img->sps.CtbSizeY; + int ctbSize = img->get_sps().CtbSizeY; int deblkSize = ctbSize/4; derive_boundaryStrength(img,vertical, @@ -406,12 +407,14 @@ { //printf("luma %d-%d %d-%d\n",xStart,xEnd,yStart,yEnd); + const seq_parameter_set& sps = img->get_sps(); + int xIncr = vertical ? 2 : 1; int yIncr = vertical ? 1 : 2; const int stride = img->get_image_stride(0); - int bitDepth_Y = img->sps.BitDepth_Y; + int bitDepth_Y = sps.BitDepth_Y; xEnd = libde265_min(xEnd,img->get_deblk_width()); yEnd = libde265_min(yEnd,img->get_deblk_height()); @@ -572,17 +575,17 @@ bool filterQ = true; if (vertical) { - if (img->sps.pcm_loop_filter_disable_flag && img->get_pcm_flag(xDi-1,yDi)) filterP=false; + if (sps.pcm_loop_filter_disable_flag && img->get_pcm_flag(xDi-1,yDi)) filterP=false; if (img->get_cu_transquant_bypass(xDi-1,yDi)) filterP=false; - if (img->sps.pcm_loop_filter_disable_flag && img->get_pcm_flag(xDi,yDi)) filterQ=false; + if (sps.pcm_loop_filter_disable_flag && img->get_pcm_flag(xDi,yDi)) filterQ=false; if (img->get_cu_transquant_bypass(xDi,yDi)) filterQ=false; } else { - if (img->sps.pcm_loop_filter_disable_flag && img->get_pcm_flag(xDi,yDi-1)) filterP=false; + if (sps.pcm_loop_filter_disable_flag && img->get_pcm_flag(xDi,yDi-1)) filterP=false; if (img->get_cu_transquant_bypass(xDi,yDi-1)) filterP=false; - if (img->sps.pcm_loop_filter_disable_flag && img->get_pcm_flag(xDi,yDi)) filterQ=false; + if (sps.pcm_loop_filter_disable_flag && img->get_pcm_flag(xDi,yDi)) filterQ=false; if (img->get_cu_transquant_bypass(xDi,yDi)) filterQ=false; } @@ -709,7 +712,7 @@ void edge_filtering_luma_CTB(de265_image* img, bool vertical, int xCtb,int yCtb) { - int ctbSize = img->sps.CtbSizeY; + int ctbSize = img->get_sps().CtbSizeY; int deblkSize = ctbSize/4; edge_filtering_luma(img,vertical, @@ -730,8 +733,10 @@ { //printf("chroma %d-%d %d-%d\n",xStart,xEnd,yStart,yEnd); - const int SubWidthC = img->sps.SubWidthC; - const int SubHeightC = img->sps.SubHeightC; + const seq_parameter_set& sps = img->get_sps(); + + const int SubWidthC = sps.SubWidthC; + const int SubHeightC = sps.SubHeightC; int xIncr = vertical ? 2 : 1; int yIncr = vertical ? 1 : 2; @@ -744,7 +749,7 @@ xEnd = libde265_min(xEnd,img->get_deblk_width()); yEnd = libde265_min(yEnd,img->get_deblk_height()); - int bitDepth_C = img->sps.BitDepth_C; + int bitDepth_C = sps.BitDepth_C;
View file
libde265-1.0.2.tar.gz/libde265/decctx.cc -> libde265-1.0.3.tar.gz/libde265/decctx.cc
Changed
@@ -124,9 +124,12 @@ //memset(this,0,sizeof(thread_context)); - // some compilers/linkers don't align struct members correctly, - // adjust if necessary - int offset = (uintptr_t)_coeffBuf & 0x0f; + // There is a interesting issue here. When aligning _coeffBuf to 16 bytes offset with + // __attribute__((align(16))), the following statement is optimized away since the + // compiler assumes that the pointer would be 16-byte aligned. However, this is not the + // case when the structure has been dynamically allocated. In this case, the base can + // also be at 8 byte offsets (at least with MingW,32 bit). + int offset = ((uintptr_t)_coeffBuf) & 0xf; if (offset == 0) { coeffBuf = _coeffBuf; // correctly aligned already @@ -463,24 +466,24 @@ // find the previous CTB in TS order - const pic_parameter_set* pps = &tctx->img->pps; - const seq_parameter_set* sps = &tctx->img->sps; + const pic_parameter_set& pps = tctx->img->get_pps(); + const seq_parameter_set& sps = tctx->img->get_sps(); if (tctx->shdr->slice_segment_address > 0) { - int prevCtb = pps->CtbAddrTStoRS[ pps->CtbAddrRStoTS[tctx->shdr->slice_segment_address] -1 ]; + int prevCtb = pps.CtbAddrTStoRS[ pps.CtbAddrRStoTS[tctx->shdr->slice_segment_address] -1 ]; - int ctbX = prevCtb % sps->PicWidthInCtbsY; - int ctbY = prevCtb / sps->PicWidthInCtbsY; + int ctbX = prevCtb % sps.PicWidthInCtbsY; + int ctbY = prevCtb / sps.PicWidthInCtbsY; // take the pixel at the bottom right corner (but consider that the image size might be smaller) - int x = ((ctbX+1) << sps->Log2CtbSizeY)-1; - int y = ((ctbY+1) << sps->Log2CtbSizeY)-1; + int x = ((ctbX+1) << sps.Log2CtbSizeY)-1; + int y = ((ctbY+1) << sps.Log2CtbSizeY)-1; - x = std::min(x,sps->pic_width_in_luma_samples-1); - y = std::min(y,sps->pic_height_in_luma_samples-1); + x = std::min(x,sps.pic_width_in_luma_samples-1); + y = std::min(y,sps.pic_height_in_luma_samples-1); //printf("READ QPY: %d %d -> %d (should %d)\n",x,y,imgunit->img->get_QPY(x,y), tc.currentQPY); @@ -527,17 +530,17 @@ { logdebug(LogHeaders,"---> read VPS\n"); - video_parameter_set vps; - de265_error err = vps.read(this,&reader); + std::shared_ptr<video_parameter_set> new_vps = std::make_shared<video_parameter_set>(); + de265_error err = new_vps->read(this,&reader); if (err != DE265_OK) { return err; } if (param_vps_headers_fd>=0) { - vps.dump(param_vps_headers_fd); + new_vps->dump(param_vps_headers_fd); } - process_vps(&vps); + vps[ new_vps->video_parameter_set_id ] = new_vps; return DE265_OK; } @@ -546,18 +549,18 @@ { logdebug(LogHeaders,"----> read SPS\n"); - seq_parameter_set sps; + std::shared_ptr<seq_parameter_set> new_sps = std::make_shared<seq_parameter_set>(); de265_error err; - if ((err=sps.read(this, &reader)) != DE265_OK) { + if ((err=new_sps->read(this, &reader)) != DE265_OK) { return err; } if (param_sps_headers_fd>=0) { - sps.dump(param_sps_headers_fd); + new_sps->dump(param_sps_headers_fd); } - process_sps(&sps); + sps[ new_sps->seq_parameter_set_id ] = new_sps; return DE265_OK; } @@ -566,16 +569,16 @@ { logdebug(LogHeaders,"----> read PPS\n"); - pic_parameter_set pps; + std::shared_ptr<pic_parameter_set> new_pps = std::make_shared<pic_parameter_set>(); - bool success = pps.read(&reader,this); + bool success = new_pps->read(&reader,this); if (param_pps_headers_fd>=0) { - pps.dump(param_pps_headers_fd); + new_pps->dump(param_pps_headers_fd); } if (success) { - process_pps(&pps); + pps[ (int)new_pps->pic_parameter_set_id ] = new_pps; } return success ? DE265_OK : DE265_WARNING_PPS_HEADER_INVALID; @@ -591,8 +594,8 @@ de265_error err = DE265_OK; - if ((err=read_sei(&reader,&sei, suffix, current_sps)) == DE265_OK) { - dump_sei(&sei, current_sps); + if ((err=read_sei(&reader,&sei, suffix, current_sps.get())) == DE265_OK) { + dump_sei(&sei, current_sps.get()); if (image_units.empty()==false && suffix) { image_units.back()->suffix_SEIs.push_back(sei); @@ -633,7 +636,7 @@ } - if (process_slice_segment_header(this, shdr, &err, nal->pts, &nal_hdr, nal->user_data) == false) + if (process_slice_segment_header(shdr, &err, nal->pts, &nal_hdr, nal->user_data) == false) { if (img!=NULL) img->integrity = INTEGRITY_NOT_DECODED; nal_parser.free_NAL_unit(nal); @@ -803,7 +806,7 @@ remove_images_from_dpb(sliceunit->shdr->RemoveReferencesList); - if (sliceunit->shdr->slice_segment_address >= imgunit->img->pps.CtbAddrRStoTS.size()) { + if (sliceunit->shdr->slice_segment_address >= imgunit->img->get_pps().CtbAddrRStoTS.size()) { return DE265_ERROR_CTB_OUTSIDE_IMAGE_AREA; } @@ -815,7 +818,7 @@ tctx.decctx = this; tctx.imgunit = imgunit; tctx.sliceunit= sliceunit; - tctx.CtbAddrInTS = imgunit->img->pps.CtbAddrRStoTS[tctx.shdr->slice_segment_address]; + tctx.CtbAddrInTS = imgunit->img->get_pps().CtbAddrRStoTS[tctx.shdr->slice_segment_address]; tctx.task = NULL; init_thread_context(&tctx); @@ -830,9 +833,9 @@ // alloc CABAC-model array if entropy_coding_sync is enabled - if (pps->entropy_coding_sync_enabled_flag && + if (imgunit->img->get_pps().entropy_coding_sync_enabled_flag && sliceunit->shdr->first_slice_segment_in_pic_flag) { - imgunit->ctx_models.resize( (img->sps.PicHeightInCtbsY-1) ); //* CONTEXT_MODEL_TABLE_LENGTH ); + imgunit->ctx_models.resize( (img->get_sps().PicHeightInCtbsY-1) ); //* CONTEXT_MODEL_TABLE_LENGTH ); } sliceunit->nThreads=1; @@ -890,21 +893,21 @@ */ de265_image* img = imgunit->img; - const pic_parameter_set* pps = &img->pps; + const pic_parameter_set& pps = img->get_pps(); sliceunit->state = slice_unit::InProgress; bool use_WPP = (img->decctx->num_worker_threads > 0 && - pps->entropy_coding_sync_enabled_flag); + pps.entropy_coding_sync_enabled_flag); bool use_tiles = (img->decctx->num_worker_threads > 0 && - pps->tiles_enabled_flag); + pps.tiles_enabled_flag); // TODO: remove this warning later when we do frame-parallel decoding if (img->decctx->num_worker_threads > 0 && - pps->entropy_coding_sync_enabled_flag == false && - pps->tiles_enabled_flag == false) { + pps.entropy_coding_sync_enabled_flag == false && + pps.tiles_enabled_flag == false) { img->decctx->add_warning(DE265_WARNING_NO_WPP_CANNOT_USE_MULTITHREADING, true); } @@ -980,10 +983,10 @@ de265_image* img = imgunit->img; slice_segment_header* shdr = sliceunit->shdr; - const pic_parameter_set* pps = &img->pps; + const pic_parameter_set& pps = img->get_pps();
View file
libde265-1.0.2.tar.gz/libde265/decctx.h -> libde265-1.0.3.tar.gz/libde265/decctx.h
Changed
@@ -35,6 +35,8 @@ #include "libde265/acceleration.h" #include "libde265/nal-parser.h" +#include <memory> + #define DE265_MAX_VPS_SETS 16 // this is the maximum as defined in the standard #define DE265_MAX_SPS_SETS 16 // this is the maximum as defined in the standard #define DE265_MAX_PPS_SETS 64 // this is the maximum as defined in the standard @@ -61,7 +63,7 @@ // motion vectors - motion_spec motion; + PBMotionCoding motion; // prediction @@ -77,8 +79,10 @@ uint8_t explicit_rdpcm_flag; uint8_t explicit_rdpcm_dir; - ALIGNED_16(int16_t) _coeffBuf[(32*32)+8]; // alignment required for SSE code ! - int16_t *coeffBuf; + // we need 16 bytes of extra memory (8*int16) to shift the base for the + // alignment required for SSE code ! + int16_t _coeffBuf[(32*32)+8]; + int16_t *coeffBuf; // the base pointer for into _coeffBuf, aligned to 16 bytes int16_t coeffList[3][32*32]; int16_t coeffPos[3][32*32]; @@ -294,10 +298,13 @@ void reset(); - /* */ seq_parameter_set* get_sps(int id) { return &sps[id]; } - const seq_parameter_set* get_sps(int id) const { return &sps[id]; } - /* */ pic_parameter_set* get_pps(int id) { return &pps[id]; } - const pic_parameter_set* get_pps(int id) const { return &pps[id]; } + bool has_sps(int id) const { return (bool)sps[id]; } + bool has_pps(int id) const { return (bool)pps[id]; } + + /* */ seq_parameter_set* get_sps(int id) { return sps[id].get(); } + const seq_parameter_set* get_sps(int id) const { return sps[id].get(); } + /* */ pic_parameter_set* get_pps(int id) { return pps[id].get(); } + const pic_parameter_set* get_pps(int id) const { return pps[id].get(); } /* const slice_segment_header* get_SliceHeader_atCtb(int ctb) { @@ -320,11 +327,8 @@ void process_nal_hdr(nal_header*); - void process_vps(video_parameter_set*); - void process_sps(seq_parameter_set*); - void process_pps(pic_parameter_set*); - bool process_slice_segment_header(decoder_context*, slice_segment_header*, + bool process_slice_segment_header(slice_segment_header*, de265_error*, de265_PTS pts, nal_header* nal_hdr, void* user_data); @@ -381,13 +385,13 @@ private: // --- internal data --- - video_parameter_set vps[ DE265_MAX_VPS_SETS ]; - seq_parameter_set sps[ DE265_MAX_SPS_SETS ]; - pic_parameter_set pps[ DE265_MAX_PPS_SETS ]; + std::shared_ptr<video_parameter_set> vps[ DE265_MAX_VPS_SETS ]; + std::shared_ptr<seq_parameter_set> sps[ DE265_MAX_SPS_SETS ]; + std::shared_ptr<pic_parameter_set> pps[ DE265_MAX_PPS_SETS ]; - video_parameter_set* current_vps; - seq_parameter_set* current_sps; - pic_parameter_set* current_pps; + std::shared_ptr<video_parameter_set> current_vps; + std::shared_ptr<seq_parameter_set> current_sps; + std::shared_ptr<pic_parameter_set> current_pps; public: thread_pool thread_pool_; @@ -505,11 +509,11 @@ slice_unit* sliceunit, int progress); - void process_picture_order_count(decoder_context* ctx, slice_segment_header* hdr); - int generate_unavailable_reference_picture(decoder_context* ctx, const seq_parameter_set* sps, + void process_picture_order_count(slice_segment_header* hdr); + int generate_unavailable_reference_picture(const seq_parameter_set* sps, int POC, bool longTerm); - void process_reference_picture_set(decoder_context* ctx, slice_segment_header* hdr); - bool construct_reference_picture_lists(decoder_context* ctx, slice_segment_header* hdr); + void process_reference_picture_set(slice_segment_header* hdr); + bool construct_reference_picture_lists(slice_segment_header* hdr); void remove_images_from_dpb(const std::vector<int>& removeImageList);
View file
libde265-1.0.2.tar.gz/libde265/dpb.cc -> libde265-1.0.3.tar.gz/libde265/dpb.cc
Changed
@@ -201,7 +201,7 @@ } -int decoded_picture_buffer::new_image(const seq_parameter_set* sps, +int decoded_picture_buffer::new_image(std::shared_ptr<const seq_parameter_set> sps, decoder_context* decctx, de265_PTS pts, void* user_data, bool isOutputImage) {
View file
libde265-1.0.2.tar.gz/libde265/dpb.h -> libde265-1.0.3.tar.gz/libde265/dpb.h
Changed
@@ -39,7 +39,7 @@ /* Alloc a new image in the DPB and return its index. If there is no space for a new image, return -1. */ - int new_image(const seq_parameter_set* sps, decoder_context* decctx, + int new_image(std::shared_ptr<const seq_parameter_set> sps, decoder_context* decctx, de265_PTS pts, void* user_data, bool isOutputImage); /* Check for a free slot in the DPB. There are some slots reserved for
View file
libde265-1.0.2.tar.gz/libde265/encoder/CMakeLists.txt -> libde265-1.0.3.tar.gz/libde265/encoder/CMakeLists.txt
Changed
@@ -1,18 +1,17 @@ -set (encoder_sources - analyze.cc analyze.h - encode.h encode.cc +set (encoder_sources + encoder-core.cc encoder-core.h + encoder-types.h encoder-types.cc encoder-params.h encoder-params.cc encoder-context.h encoder-context.cc + encoder-syntax.h encoder-syntax.cc encpicbuf.h encpicbuf.cc sop.h sop.cc ) -add_library(encoder STATIC ${encoder_sources}) +add_subdirectory (algo) +add_library(encoder OBJECT ${encoder_sources}) +set(ENCODER_OBJECTS $<TARGET_OBJECTS:encoder> ${ALGO_OBJECTS} PARENT_SCOPE) if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") SET_TARGET_PROPERTIES(encoder PROPERTIES COMPILE_FLAGS "-fPIC") endif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") - -add_subdirectory (algo) - -target_link_libraries(encoder algo)
View file
libde265-1.0.2.tar.gz/libde265/encoder/Makefile.am -> libde265-1.0.3.tar.gz/libde265/encoder/Makefile.am
Changed
@@ -2,10 +2,11 @@ libde265_encoder_la_CXXFLAGS = -I.. libde265_encoder_la_SOURCES = \ - analyze.cc analyze.h \ - encode.h encode.cc \ + encoder-core.cc encoder-core.h \ + encoder-types.h encoder-types.cc \ encoder-params.h encoder-params.cc \ encoder-context.h encoder-context.cc \ + encoder-syntax.h encoder-syntax.cc \ encpicbuf.h encpicbuf.cc \ sop.h sop.cc
View file
libde265-1.0.2.tar.gz/libde265/encoder/Makefile.in -> libde265-1.0.3.tar.gz/libde265/encoder/Makefile.in
Changed
@@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -15,7 +15,17 @@ @SET_MAKE@ VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -80,8 +90,6 @@ host_triplet = @host@ target_triplet = @target@ subdir = libde265/encoder -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ @@ -92,16 +100,18 @@ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libde265_encoder_la_DEPENDENCIES = algo/libde265_encoder_algo.la -am_libde265_encoder_la_OBJECTS = libde265_encoder_la-analyze.lo \ - libde265_encoder_la-encode.lo \ +am_libde265_encoder_la_OBJECTS = libde265_encoder_la-encoder-core.lo \ + libde265_encoder_la-encoder-types.lo \ libde265_encoder_la-encoder-params.lo \ libde265_encoder_la-encoder-context.lo \ + libde265_encoder_la-encoder-syntax.lo \ libde265_encoder_la-encpicbuf.lo libde265_encoder_la-sop.lo libde265_encoder_la_OBJECTS = $(am_libde265_encoder_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) @@ -207,6 +217,7 @@ ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ @@ -284,6 +295,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -366,6 +378,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -381,10 +394,11 @@ noinst_LTLIBRARIES = libde265_encoder.la libde265_encoder_la_CXXFLAGS = -I.. libde265_encoder_la_SOURCES = \ - analyze.cc analyze.h \ - encode.h encode.cc \ + encoder-core.cc encoder-core.h \ + encoder-types.h encoder-types.cc \ encoder-params.h encoder-params.cc \ encoder-context.h encoder-context.cc \ + encoder-syntax.h encoder-syntax.cc \ encpicbuf.h encpicbuf.cc \ sop.h sop.cc @@ -409,7 +423,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libde265/encoder/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libde265/encoder/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -448,10 +461,11 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libde265_encoder_la-analyze.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libde265_encoder_la-encode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libde265_encoder_la-encoder-context.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libde265_encoder_la-encoder-core.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libde265_encoder_la-encoder-params.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libde265_encoder_la-encoder-syntax.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libde265_encoder_la-encoder-types.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libde265_encoder_la-encpicbuf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libde265_encoder_la-sop.Plo@am__quote@ @@ -476,19 +490,19 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< -libde265_encoder_la-analyze.lo: analyze.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libde265_encoder_la_CXXFLAGS) $(CXXFLAGS) -MT libde265_encoder_la-analyze.lo -MD -MP -MF $(DEPDIR)/libde265_encoder_la-analyze.Tpo -c -o libde265_encoder_la-analyze.lo `test -f 'analyze.cc' || echo '$(srcdir)/'`analyze.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libde265_encoder_la-analyze.Tpo $(DEPDIR)/libde265_encoder_la-analyze.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='analyze.cc' object='libde265_encoder_la-analyze.lo' libtool=yes @AMDEPBACKSLASH@ +libde265_encoder_la-encoder-core.lo: encoder-core.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libde265_encoder_la_CXXFLAGS) $(CXXFLAGS) -MT libde265_encoder_la-encoder-core.lo -MD -MP -MF $(DEPDIR)/libde265_encoder_la-encoder-core.Tpo -c -o libde265_encoder_la-encoder-core.lo `test -f 'encoder-core.cc' || echo '$(srcdir)/'`encoder-core.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libde265_encoder_la-encoder-core.Tpo $(DEPDIR)/libde265_encoder_la-encoder-core.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='encoder-core.cc' object='libde265_encoder_la-encoder-core.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libde265_encoder_la_CXXFLAGS) $(CXXFLAGS) -c -o libde265_encoder_la-analyze.lo `test -f 'analyze.cc' || echo '$(srcdir)/'`analyze.cc +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libde265_encoder_la_CXXFLAGS) $(CXXFLAGS) -c -o libde265_encoder_la-encoder-core.lo `test -f 'encoder-core.cc' || echo '$(srcdir)/'`encoder-core.cc -libde265_encoder_la-encode.lo: encode.cc -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libde265_encoder_la_CXXFLAGS) $(CXXFLAGS) -MT libde265_encoder_la-encode.lo -MD -MP -MF $(DEPDIR)/libde265_encoder_la-encode.Tpo -c -o libde265_encoder_la-encode.lo `test -f 'encode.cc' || echo '$(srcdir)/'`encode.cc -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libde265_encoder_la-encode.Tpo $(DEPDIR)/libde265_encoder_la-encode.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='encode.cc' object='libde265_encoder_la-encode.lo' libtool=yes @AMDEPBACKSLASH@ +libde265_encoder_la-encoder-types.lo: encoder-types.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libde265_encoder_la_CXXFLAGS) $(CXXFLAGS) -MT libde265_encoder_la-encoder-types.lo -MD -MP -MF $(DEPDIR)/libde265_encoder_la-encoder-types.Tpo -c -o libde265_encoder_la-encoder-types.lo `test -f 'encoder-types.cc' || echo '$(srcdir)/'`encoder-types.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libde265_encoder_la-encoder-types.Tpo $(DEPDIR)/libde265_encoder_la-encoder-types.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='encoder-types.cc' object='libde265_encoder_la-encoder-types.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libde265_encoder_la_CXXFLAGS) $(CXXFLAGS) -c -o libde265_encoder_la-encode.lo `test -f 'encode.cc' || echo '$(srcdir)/'`encode.cc +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libde265_encoder_la_CXXFLAGS) $(CXXFLAGS) -c -o libde265_encoder_la-encoder-types.lo `test -f 'encoder-types.cc' || echo '$(srcdir)/'`encoder-types.cc libde265_encoder_la-encoder-params.lo: encoder-params.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libde265_encoder_la_CXXFLAGS) $(CXXFLAGS) -MT libde265_encoder_la-encoder-params.lo -MD -MP -MF $(DEPDIR)/libde265_encoder_la-encoder-params.Tpo -c -o libde265_encoder_la-encoder-params.lo `test -f 'encoder-params.cc' || echo '$(srcdir)/'`encoder-params.cc @@ -504,6 +518,13 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libde265_encoder_la_CXXFLAGS) $(CXXFLAGS) -c -o libde265_encoder_la-encoder-context.lo `test -f 'encoder-context.cc' || echo '$(srcdir)/'`encoder-context.cc +libde265_encoder_la-encoder-syntax.lo: encoder-syntax.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libde265_encoder_la_CXXFLAGS) $(CXXFLAGS) -MT libde265_encoder_la-encoder-syntax.lo -MD -MP -MF $(DEPDIR)/libde265_encoder_la-encoder-syntax.Tpo -c -o libde265_encoder_la-encoder-syntax.lo `test -f 'encoder-syntax.cc' || echo '$(srcdir)/'`encoder-syntax.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libde265_encoder_la-encoder-syntax.Tpo $(DEPDIR)/libde265_encoder_la-encoder-syntax.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='encoder-syntax.cc' object='libde265_encoder_la-encoder-syntax.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libde265_encoder_la_CXXFLAGS) $(CXXFLAGS) -c -o libde265_encoder_la-encoder-syntax.lo `test -f 'encoder-syntax.cc' || echo '$(srcdir)/'`encoder-syntax.cc + libde265_encoder_la-encpicbuf.lo: encpicbuf.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libde265_encoder_la_CXXFLAGS) $(CXXFLAGS) -MT libde265_encoder_la-encpicbuf.lo -MD -MP -MF $(DEPDIR)/libde265_encoder_la-encpicbuf.Tpo -c -o libde265_encoder_la-encpicbuf.lo `test -f 'encpicbuf.cc' || echo '$(srcdir)/'`encpicbuf.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libde265_encoder_la-encpicbuf.Tpo $(DEPDIR)/libde265_encoder_la-encpicbuf.Plo @@ -801,6 +822,8 @@ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am +.PRECIOUS: Makefile + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded.
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/CMakeLists.txt -> libde265-1.0.3.tar.gz/libde265/encoder/algo/CMakeLists.txt
Changed
@@ -9,11 +9,14 @@ cb-intra-inter.h cb-intra-inter.cc cb-mergeindex.h cb-mergeindex.cc tb-split.h tb-split.cc + tb-transform.h tb-transform.cc tb-intrapredmode.h tb-intrapredmode.cc + tb-rateestim.h tb-rateestim.cc pb-mv.h pb-mv.cc ) -add_library(algo STATIC ${algo_sources}) +add_library(algo OBJECT ${algo_sources}) +set(ALGO_OBJECTS $<TARGET_OBJECTS:algo> PARENT_SCOPE) if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") SET_TARGET_PROPERTIES(algo PROPERTIES COMPILE_FLAGS "-fPIC")
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/Makefile.am -> libde265-1.0.3.tar.gz/libde265/encoder/algo/Makefile.am
Changed
@@ -12,7 +12,9 @@ cb-intra-inter.h cb-intra-inter.cc \ cb-mergeindex.h cb-mergeindex.cc \ tb-split.h tb-split.cc \ + tb-transform.h tb-transform.cc \ tb-intrapredmode.h tb-intrapredmode.cc \ + tb-rateestim.h tb-rateestim.cc \ pb-mv.h pb-mv.cc EXTRA_DIST = \
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/Makefile.in -> libde265-1.0.3.tar.gz/libde265/encoder/algo/Makefile.in
Changed
@@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -15,7 +15,17 @@ @SET_MAKE@ VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -80,8 +90,6 @@ host_triplet = @host@ target_triplet = @target@ subdir = libde265/encoder/algo -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ @@ -92,6 +100,7 @@ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -109,7 +118,9 @@ libde265_encoder_algo_la-cb-intra-inter.lo \ libde265_encoder_algo_la-cb-mergeindex.lo \ libde265_encoder_algo_la-tb-split.lo \ + libde265_encoder_algo_la-tb-transform.lo \ libde265_encoder_algo_la-tb-intrapredmode.lo \ + libde265_encoder_algo_la-tb-rateestim.lo \ libde265_encoder_algo_la-pb-mv.lo libde265_encoder_algo_la_OBJECTS = \ $(am_libde265_encoder_algo_la_OBJECTS) @@ -199,6 +210,7 @@ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ @@ -251,6 +263,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -333,6 +346,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -358,7 +372,9 @@ cb-intra-inter.h cb-intra-inter.cc \ cb-mergeindex.h cb-mergeindex.cc \ tb-split.h tb-split.cc \ + tb-transform.h tb-transform.cc \ tb-intrapredmode.h tb-intrapredmode.cc \ + tb-rateestim.h tb-rateestim.cc \ pb-mv.h pb-mv.cc EXTRA_DIST = \ @@ -380,7 +396,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libde265/encoder/algo/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libde265/encoder/algo/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -430,7 +445,9 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libde265_encoder_algo_la-ctb-qscale.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libde265_encoder_algo_la-pb-mv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libde265_encoder_algo_la-tb-intrapredmode.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libde265_encoder_algo_la-tb-rateestim.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libde265_encoder_algo_la-tb-split.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libde265_encoder_algo_la-tb-transform.Plo@am__quote@ .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -523,6 +540,13 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libde265_encoder_algo_la_CXXFLAGS) $(CXXFLAGS) -c -o libde265_encoder_algo_la-tb-split.lo `test -f 'tb-split.cc' || echo '$(srcdir)/'`tb-split.cc +libde265_encoder_algo_la-tb-transform.lo: tb-transform.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libde265_encoder_algo_la_CXXFLAGS) $(CXXFLAGS) -MT libde265_encoder_algo_la-tb-transform.lo -MD -MP -MF $(DEPDIR)/libde265_encoder_algo_la-tb-transform.Tpo -c -o libde265_encoder_algo_la-tb-transform.lo `test -f 'tb-transform.cc' || echo '$(srcdir)/'`tb-transform.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libde265_encoder_algo_la-tb-transform.Tpo $(DEPDIR)/libde265_encoder_algo_la-tb-transform.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tb-transform.cc' object='libde265_encoder_algo_la-tb-transform.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libde265_encoder_algo_la_CXXFLAGS) $(CXXFLAGS) -c -o libde265_encoder_algo_la-tb-transform.lo `test -f 'tb-transform.cc' || echo '$(srcdir)/'`tb-transform.cc + libde265_encoder_algo_la-tb-intrapredmode.lo: tb-intrapredmode.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libde265_encoder_algo_la_CXXFLAGS) $(CXXFLAGS) -MT libde265_encoder_algo_la-tb-intrapredmode.lo -MD -MP -MF $(DEPDIR)/libde265_encoder_algo_la-tb-intrapredmode.Tpo -c -o libde265_encoder_algo_la-tb-intrapredmode.lo `test -f 'tb-intrapredmode.cc' || echo '$(srcdir)/'`tb-intrapredmode.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libde265_encoder_algo_la-tb-intrapredmode.Tpo $(DEPDIR)/libde265_encoder_algo_la-tb-intrapredmode.Plo @@ -530,6 +554,13 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libde265_encoder_algo_la_CXXFLAGS) $(CXXFLAGS) -c -o libde265_encoder_algo_la-tb-intrapredmode.lo `test -f 'tb-intrapredmode.cc' || echo '$(srcdir)/'`tb-intrapredmode.cc +libde265_encoder_algo_la-tb-rateestim.lo: tb-rateestim.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libde265_encoder_algo_la_CXXFLAGS) $(CXXFLAGS) -MT libde265_encoder_algo_la-tb-rateestim.lo -MD -MP -MF $(DEPDIR)/libde265_encoder_algo_la-tb-rateestim.Tpo -c -o libde265_encoder_algo_la-tb-rateestim.lo `test -f 'tb-rateestim.cc' || echo '$(srcdir)/'`tb-rateestim.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libde265_encoder_algo_la-tb-rateestim.Tpo $(DEPDIR)/libde265_encoder_algo_la-tb-rateestim.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tb-rateestim.cc' object='libde265_encoder_algo_la-tb-rateestim.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libde265_encoder_algo_la_CXXFLAGS) $(CXXFLAGS) -c -o libde265_encoder_algo_la-tb-rateestim.lo `test -f 'tb-rateestim.cc' || echo '$(srcdir)/'`tb-rateestim.cc + libde265_encoder_algo_la-pb-mv.lo: pb-mv.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libde265_encoder_algo_la_CXXFLAGS) $(CXXFLAGS) -MT libde265_encoder_algo_la-pb-mv.lo -MD -MP -MF $(DEPDIR)/libde265_encoder_algo_la-pb-mv.Tpo -c -o libde265_encoder_algo_la-pb-mv.lo `test -f 'pb-mv.cc' || echo '$(srcdir)/'`pb-mv.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libde265_encoder_algo_la-pb-mv.Tpo $(DEPDIR)/libde265_encoder_algo_la-pb-mv.Plo @@ -746,6 +777,8 @@ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am +.PRECIOUS: Makefile + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded.
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/algo.cc -> libde265-1.0.3.tar.gz/libde265/encoder/algo/algo.cc
Changed
@@ -22,3 +22,74 @@ #include "libde265/encoder/algo/algo.h" #include "libde265/encoder/encoder-context.h" + +#include <stdarg.h> + + + +#ifdef DE265_LOG_DEBUG +static int descendLevel = 0; + +void Algo::enter() +{ + if (logdebug_enabled(LogEncoder)) { + printf("%d",descendLevel+1); + for (int i=0;i<descendLevel+1;i++) { printf(" "); } + printf(":%s\n",name()); + } +} + +void Algo::descend(const enc_node* node, const char* option, ...) +{ + if (logdebug_enabled(LogEncoder)) { + descendLevel++; + printf("%d ",descendLevel); + for (int i=0;i<descendLevel;i++) { printf(" "); } + + va_list va; + va_start(va, option); + va_end(va); + + fprintf(stdout, ">%s(", name()); + vfprintf(stdout, option, va); + fprintf(stdout, ") %d;%d %dx%d %p\n",node->x,node->y,1<<node->log2Size,1<<node->log2Size,node); + } +} + +void Algo::ascend(const enc_node* resultNode, const char* fmt, ...) +{ + if (logdebug_enabled(LogEncoder)) { + if (fmt != NULL) { + printf("%d ",descendLevel); + for (int i=0;i<descendLevel;i++) { printf(" "); } + + va_list va; + va_start(va, fmt); + va_end(va); + + fprintf(stdout, "<%s(", name()); + vfprintf(stdout, fmt, va); + fprintf(stdout, ") <- %p\n",resultNode); + } + + descendLevel--; + } +} + +void Algo::leaf(const enc_node* node, const char* option, ...) +{ + if (logdebug_enabled(LogEncoder)) { + printf("%d ",descendLevel+1); + for (int i=0;i<descendLevel+1;i++) { printf(" "); } + + va_list va; + va_start(va, option); + va_end(va); + + fprintf(stdout, "%s(", name()); + vfprintf(stdout, option, va); + fprintf(stdout, ") %d;%d %dx%d\n",node->x,node->y,1<<node->log2Size,1<<node->log2Size); + } +} + +#endif
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/algo.h -> libde265-1.0.3.tar.gz/libde265/encoder/algo/algo.h
Changed
@@ -23,26 +23,47 @@ #ifndef ALGO_H #define ALGO_H -#include "libde265/encoder/encode.h" +#include "libde265/encoder/encoder-types.h" /* When entering the next recursion level, it is assumed that a valid CB structure is passed down. Ownership is transferred to the new algorithm. That algorithm passes back a (possibly different) - CB structure that the first algorithm should use. The original CB - structure might have been deleted in the called algorithm. + CB structure that the first algorithm should use. The receiving + algorithm will be the owner of the passed back algorithm. + The original CB structure might have been deleted in the called algorithm. + + When using CodingOptions, it is important to set the passed back + enc_node in the CodingOption (set_node()), so that the CodingOption + can correctly handle ownership and delete nodes as needed. The context_model_table passed down is at the current state. When the algorithm returns, the state should represent the state after running this algorithm. - - When returning from the algorithm, it is also assumed that the - ectx->img content (reconstruction and metadata) represent the - current state. When the algorithm tries several variants, it - has to restore the state to the selected variant. */ -class Algo_CB +class Algo +{ + public: + virtual ~Algo() { } + + virtual const char* name() const { return "noname"; } + +#ifdef DE265_LOG_DEBUG + void enter(); + void descend(const enc_node* node,const char* option_description, ...); + void ascend(const enc_node* resultNode=NULL, const char* fmt=NULL, ...); + void leaf(const enc_node* node,const char* option_description, ...); +#else + inline void enter() { } + inline void descend(const enc_node*,const char*, ...) { } + inline void ascend(const enc_node* resultNode=NULL,const char* fmt=NULL, ...) { } + inline void leaf(const enc_node*,const char*, ...) { } +#endif +}; + + +class Algo_CB : public Algo { public: virtual ~Algo_CB() { } @@ -59,7 +80,7 @@ }; -class Algo_PB +class Algo_PB : public Algo { public: virtual ~Algo_PB() { }
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/cb-interpartmode.cc -> libde265-1.0.3.tar.gz/libde265/encoder/algo/cb-interpartmode.cc
Changed
@@ -48,46 +48,46 @@ case PART_NxN: s = 1<<(log2Size-1); - cb = mChildAlgo->analyze(ectx, ctxModel, cb, 0, x ,y ,s,s); - cb = mChildAlgo->analyze(ectx, ctxModel, cb, 1, x+s,y ,s,s); - cb = mChildAlgo->analyze(ectx, ctxModel, cb, 2, x ,y+s,s,s); - cb = mChildAlgo->analyze(ectx, ctxModel, cb, 3, x+s,y+s,s,s); + descend(cb,"NxN(1/4)"); cb = mChildAlgo->analyze(ectx, ctxModel, cb, 0, x ,y ,s,s); ascend(); + descend(cb,"NxN(2/4)"); cb = mChildAlgo->analyze(ectx, ctxModel, cb, 1, x+s,y ,s,s); ascend(); + descend(cb,"NxN(3/4)"); cb = mChildAlgo->analyze(ectx, ctxModel, cb, 2, x ,y+s,s,s); ascend(); + descend(cb,"NxN(4/4)"); cb = mChildAlgo->analyze(ectx, ctxModel, cb, 3, x+s,y+s,s,s); ascend(); break; case PART_2NxN: s = 1<<(log2Size-1); - cb = mChildAlgo->analyze(ectx, ctxModel, cb, 0, x,y ,w,s); - cb = mChildAlgo->analyze(ectx, ctxModel, cb, 1, x,y+s,w,s); + descend(cb,"2NxN(1/2)"); cb = mChildAlgo->analyze(ectx, ctxModel, cb, 0, x,y ,w,s); ascend(); + descend(cb,"2NxN(2/2)"); cb = mChildAlgo->analyze(ectx, ctxModel, cb, 1, x,y+s,w,s); ascend(); break; case PART_Nx2N: s = 1<<(log2Size-1); - cb = mChildAlgo->analyze(ectx, ctxModel, cb, 0, x ,y,s,w); - cb = mChildAlgo->analyze(ectx, ctxModel, cb, 1, x+s,y,s,w); + descend(cb,"Nx2N(1/2)"); cb = mChildAlgo->analyze(ectx, ctxModel, cb, 0, x ,y,s,w); ascend(); + descend(cb,"Nx2N(2/2)"); cb = mChildAlgo->analyze(ectx, ctxModel, cb, 1, x+s,y,s,w); ascend(); break; case PART_2NxnU: s = 1<<(log2Size-2); - cb = mChildAlgo->analyze(ectx, ctxModel, cb, 0, x,y ,w,s); - cb = mChildAlgo->analyze(ectx, ctxModel, cb, 1, x,y+s,w,w-s); + descend(cb,"2NxnU(1/2)"); cb = mChildAlgo->analyze(ectx, ctxModel, cb, 0, x,y ,w,s); ascend(); + descend(cb,"2NxnU(2/2)"); cb = mChildAlgo->analyze(ectx, ctxModel, cb, 1, x,y+s,w,w-s); ascend(); break; case PART_2NxnD: s = 1<<(log2Size-2); - cb = mChildAlgo->analyze(ectx, ctxModel, cb, 0, x,y ,w,w-s); - cb = mChildAlgo->analyze(ectx, ctxModel, cb, 1, x,y+w-s,w,s); + descend(cb,"2NxnD(1/2)"); cb = mChildAlgo->analyze(ectx, ctxModel, cb, 0, x,y ,w,w-s); ascend(); + descend(cb,"2NxnD(2/2)"); cb = mChildAlgo->analyze(ectx, ctxModel, cb, 1, x,y+w-s,w,s); ascend(); break; case PART_nLx2N: s = 1<<(log2Size-2); - cb = mChildAlgo->analyze(ectx, ctxModel, cb, 0, x ,y,s ,w); - cb = mChildAlgo->analyze(ectx, ctxModel, cb, 1, x+s,y,w-s,w); + descend(cb,"nLx2N(1/2)"); cb = mChildAlgo->analyze(ectx, ctxModel, cb, 0, x ,y,s ,w); ascend(); + descend(cb,"nLx2N(2/2)"); cb = mChildAlgo->analyze(ectx, ctxModel, cb, 1, x+s,y,w-s,w); ascend(); break; case PART_nRx2N: s = 1<<(log2Size-2); - cb = mChildAlgo->analyze(ectx, ctxModel, cb, 0, x ,y,w-s,w); - cb = mChildAlgo->analyze(ectx, ctxModel, cb, 1, x+w-s,y,s ,w); + descend(cb,"nRx2N(1/2)"); cb = mChildAlgo->analyze(ectx, ctxModel, cb, 0, x ,y,w-s,w); ascend(); + descend(cb,"nRx2N(2/2)"); cb = mChildAlgo->analyze(ectx, ctxModel, cb, 1, x+w-s,y,s ,w); ascend(); break; }
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/cb-interpartmode.h -> libde265-1.0.3.tar.gz/libde265/encoder/algo/cb-interpartmode.h
Changed
@@ -25,7 +25,6 @@ #include "libde265/nal-parser.h" #include "libde265/decctx.h" -#include "libde265/encoder/encode.h" #include "libde265/slice.h" #include "libde265/scan.h" #include "libde265/intrapred.h" @@ -50,6 +49,8 @@ void setChildAlgo(Algo_PB* algo) { mChildAlgo = algo; } + virtual const char* name() const { return "cb-interpartmode"; } + protected: Algo_PB* mChildAlgo; @@ -98,6 +99,8 @@ context_model_table&, enc_cb* cb); + virtual const char* name() const { return "cb-interpartmode-fixed"; } + private: params mParams; };
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/cb-intra-inter.cc -> libde265-1.0.3.tar.gz/libde265/encoder/algo/cb-intra-inter.cc
Changed
@@ -40,7 +40,7 @@ bool try_inter = (ectx->shdr->slice_type != SLICE_TYPE_I); bool debug_halt = try_inter; - //try_inter = false; + try_inter = false; //try_intra = !try_inter; // TODO HACK: no intra in inter frames if (ectx->imgdata->frame_number > 0) { @@ -50,10 +50,10 @@ // 0: intra // 1: inter - CodingOptions options(ectx,cb,ctxModel); + CodingOptions<enc_cb> options(ectx,cb,ctxModel); - CodingOption option_intra = options.new_option(try_intra); - CodingOption option_inter = options.new_option(try_inter); + CodingOption<enc_cb> option_intra = options.new_option(try_intra); + CodingOption<enc_cb> option_inter = options.new_option(try_inter); options.start(); @@ -69,13 +69,15 @@ if (option_inter) { option_inter.begin(); - cb_inter = option_inter.get_cb(); + cb_inter = option_inter.get_node(); cb_inter->PredMode = MODE_INTER; ectx->img->set_pred_mode(x,y, log2CbSize, MODE_INTER); enc_cb* cb_result; + descend(cb,"inter"); cb_result=mInterAlgo->analyze(ectx, option_inter.get_context(), cb_inter); + ascend(); if (cb_result->PredMode != MODE_SKIP) { CABAC_encoder_estim* cabac = option_inter.get_cabac(); @@ -88,7 +90,7 @@ cb_result->rate += rate_pred_mode_flag; } - option_inter.set_cb(cb_result); + option_inter.set_node(cb_result); option_inter.end(); } @@ -98,13 +100,15 @@ if (option_intra) { option_intra.begin(); - cb_intra = option_intra.get_cb(); + cb_intra = option_intra.get_node(); cb_intra->PredMode = MODE_INTRA; ectx->img->set_pred_mode(x,y, log2CbSize, MODE_INTRA); enc_cb* cb_result; + descend(cb,"intra"); cb_result=mIntraAlgo->analyze(ectx, option_intra.get_context(), cb_intra); + ascend(); if (ectx->shdr->slice_type != SLICE_TYPE_I) { CABAC_encoder_estim* cabac = option_intra.get_cabac(); @@ -117,12 +121,12 @@ cb_result->rate += rate_pred_mode_flag; } - option_intra.set_cb(cb_result); + option_intra.set_node(cb_result); option_intra.end(); } options.compute_rdo_costs(); - return options.return_best_rdo(); + return options.return_best_rdo_node(); }
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/cb-intra-inter.h -> libde265-1.0.3.tar.gz/libde265/encoder/algo/cb-intra-inter.h
Changed
@@ -25,7 +25,6 @@ #include "libde265/nal-parser.h" #include "libde265/decctx.h" -#include "libde265/encoder/encode.h" #include "libde265/slice.h" #include "libde265/scan.h" #include "libde265/intrapred.h" @@ -51,6 +50,8 @@ void setIntraChildAlgo(Algo_CB* algo) { mIntraAlgo = algo; } void setInterChildAlgo(Algo_CB* algo) { mInterAlgo = algo; } + virtual const char* name() const { return "cb-intra-inter"; } + protected: Algo_CB* mIntraAlgo; Algo_CB* mInterAlgo;
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/cb-intrapartmode.cc -> libde265-1.0.3.tar.gz/libde265/encoder/algo/cb-intrapartmode.cc
Changed
@@ -42,8 +42,8 @@ const int x = cb_in->x; const int y = cb_in->y; - const bool can_use_NxN = ((log2CbSize == ectx->sps.Log2MinCbSizeY) && - (log2CbSize > ectx->sps.Log2MinTrafoSize)); + const bool can_use_NxN = ((log2CbSize == ectx->get_sps().Log2MinCbSizeY) && + (log2CbSize > ectx->get_sps().Log2MinTrafoSize)); // test all modes @@ -54,8 +54,8 @@ // 0: 2Nx2N (always checked) // 1: NxN (only checked at MinCbSize) - CodingOptions options(ectx,cb_in,ctxModel); - CodingOption option[2]; + CodingOptions<enc_cb> options(ectx,cb_in,ctxModel); + CodingOption<enc_cb> option[2]; option[0] = options.new_option(true); option[1] = options.new_option(can_use_NxN); @@ -65,7 +65,8 @@ if (option[p]) { option[p].begin(); - enc_cb* cb = option[p].get_cb(); + enc_cb* cb = option[p].get_node(); + *(cb_in->downPtr) = cb; // --- set intra prediction mode --- @@ -74,17 +75,23 @@ ectx->img->set_pred_mode(x,y, log2CbSize, cb->PredMode); // TODO: probably unnecessary ectx->img->set_PartMode (x,y, cb->PartMode); + // encode transform tree int IntraSplitFlag= (cb->PredMode == MODE_INTRA && cb->PartMode == PART_NxN); - int MaxTrafoDepth = ectx->sps.max_transform_hierarchy_depth_intra + IntraSplitFlag; + int MaxTrafoDepth = ectx->get_sps().max_transform_hierarchy_depth_intra + IntraSplitFlag; + + descend(cb,p==0 ? "2Nx2N" : "NxN"); + + enc_tb* tb = new enc_tb(x,y,log2CbSize,cb); + tb->downPtr = &cb->transform_tree; cb->transform_tree = mTBIntraPredModeAlgo->analyze(ectx, option[p].get_context(), - ectx->imgdata->input, NULL, cb, - x,y, x,y, log2CbSize, - 0, + ectx->imgdata->input, tb, 0, MaxTrafoDepth, IntraSplitFlag); + ascend(); + cb->distortion = cb->transform_tree->distortion; cb->rate = cb->transform_tree->rate; @@ -92,7 +99,7 @@ // rate for cu syntax logtrace(LogSymbols,"$1 part_mode=%d\n",cb->PartMode); - if (log2CbSize == ectx->sps.Log2MinCbSizeY) { + if (log2CbSize == ectx->get_sps().Log2MinCbSizeY) { int bin = (cb->PartMode==PART_2Nx2N); option[p].get_cabac()->reset(); option[p].get_cabac()->write_CABAC_bit(CONTEXT_MODEL_PART_MODE+0, bin); @@ -103,7 +110,9 @@ } options.compute_rdo_costs(); - return options.return_best_rdo(); + enc_cb* bestCB = options.return_best_rdo_node(); + + return bestCB; } @@ -111,9 +120,6 @@ context_model_table& ctxModel, enc_cb* cb) { - std::cout << "CB-IntraPartMode in size=" << (1<<cb->log2Size) - << " hash=" << ctxModel.debug_dump() << "\n"; - enum PartMode PartMode = mParams.partMode(); @@ -125,7 +131,7 @@ // NxN can only be applied at minimum CB size. // If we are not at the minimum size, we have to use 2Nx2N. - if (PartMode==PART_NxN && log2CbSize != ectx->sps.Log2MinCbSizeY) { + if (PartMode==PART_NxN && log2CbSize != ectx->get_sps().Log2MinCbSizeY) { PartMode = PART_2Nx2N; } @@ -139,13 +145,17 @@ // encode transform tree int IntraSplitFlag= (cb->PredMode == MODE_INTRA && cb->PartMode == PART_NxN); - int MaxTrafoDepth = ectx->sps.max_transform_hierarchy_depth_intra + IntraSplitFlag; + int MaxTrafoDepth = ectx->get_sps().max_transform_hierarchy_depth_intra + IntraSplitFlag; + + enc_tb* tb = new enc_tb(x,y,log2CbSize,cb); + tb->blkIdx = 0; + tb->downPtr = &cb->transform_tree; + descend(cb,"fixed:%s", (PartMode==PART_2Nx2N ? "2Nx2N":"NxN")); cb->transform_tree = mTBIntraPredModeAlgo->analyze(ectx, ctxModel, - ectx->imgdata->input, NULL, cb, - cb->x,cb->y, cb->x,cb->y, log2CbSize, - 0, + ectx->imgdata->input, tb, 0, MaxTrafoDepth, IntraSplitFlag); + ascend(); // rate and distortion for this CB @@ -153,8 +163,6 @@ cb->distortion = cb->transform_tree->distortion; cb->rate = cb->transform_tree->rate; - std::cout << "SUM TB-tree hinter PartMode " << cb->rate << "\n"; - // rate for cu syntax @@ -166,15 +174,12 @@ //encode_part_mode(ectx,&estim, MODE_INTRA, PartMode, 0); logtrace(LogSymbols,"$1 part_mode=%d\n",PartMode); - if (log2CbSize == ectx->sps.Log2MinCbSizeY) { + if (log2CbSize == ectx->get_sps().Log2MinCbSizeY) { int bin = (PartMode==PART_2Nx2N); estim.write_CABAC_bit(CONTEXT_MODEL_PART_MODE+0, bin); } cb->rate += estim.getRDBits(); - std::cout << "CB-IntraPartMode out size=" << (1<<cb->log2Size) - << " hash=" << ctxModel.debug_dump() << "\n"; - return cb; }
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/cb-intrapartmode.h -> libde265-1.0.3.tar.gz/libde265/encoder/algo/cb-intrapartmode.h
Changed
@@ -25,7 +25,7 @@ #include "libde265/nal-parser.h" #include "libde265/decctx.h" -#include "libde265/encoder/encode.h" +#include "libde265/encoder/encoder-types.h" #include "libde265/slice.h" #include "libde265/scan.h" #include "libde265/intrapred.h" @@ -83,6 +83,8 @@ void setChildAlgo(Algo_TB_IntraPredMode* algo) { mTBIntraPredModeAlgo = algo; } + virtual const char* name() const { return "cb-intrapartmode"; } + protected: Algo_TB_IntraPredMode* mTBIntraPredModeAlgo; }; @@ -95,6 +97,8 @@ virtual enc_cb* analyze(encoder_context*, context_model_table&, enc_cb* cb); + + virtual const char* name() const { return "cb-intrapartmode-bruteforce"; } }; @@ -135,6 +139,8 @@ context_model_table& ctxModel, enc_cb* cb); + virtual const char* name() const { return "cb-intrapartmode-fixed"; } + private: params mParams; };
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/cb-mergeindex.cc -> libde265-1.0.3.tar.gz/libde265/encoder/algo/cb-mergeindex.cc
Changed
@@ -23,6 +23,7 @@ #include "libde265/encoder/algo/cb-mergeindex.h" #include "libde265/encoder/encoder-context.h" +#include "libde265/encoder/encoder-syntax.h" #include <assert.h> #include <limits> #include <math.h> @@ -38,21 +39,21 @@ assert(cb->PredMode==MODE_SKIP); // TODO: || (cb->PredMode==MODE_INTER && cb->inter.skip_flag)); - MotionVectorSpec mergeCandList[5]; + PBMotion mergeCandList[5]; int partIdx = 0; int cbSize = 1 << cb->log2Size; - get_merge_candidate_list(ectx, ectx->shdr, ectx->img, - cb->x, cb->y, // xC/yC - cb->x, cb->y, // xP/yP - cbSize, // nCS - cbSize,cbSize, // nPbW/nPbH - partIdx, // partIdx - mergeCandList); + get_merge_candidate_list_from_tree(ectx, ectx->shdr, + cb->x, cb->y, // xC/yC + cb->x, cb->y, // xP/yP + cbSize, // nCS + cbSize,cbSize, // nPbW/nPbH + partIdx, // partIdx + mergeCandList); - motion_spec& spec = cb->inter.pb[partIdx].spec; + PBMotionCoding& spec = cb->inter.pb[partIdx].spec; spec.merge_flag = 1; // we use merge mode spec.merge_idx = 0; @@ -75,11 +76,12 @@ // TODO: fake motion data - const MotionVectorSpec& vec = mergeCandList[spec.merge_idx]; + const PBMotion& vec = mergeCandList[spec.merge_idx]; cb->inter.pb[partIdx].motion = vec; - ectx->img->set_mv_info(cb->x,cb->y, 1<<cb->log2Size,1<<cb->log2Size, vec); + //ectx->img->set_mv_info(cb->x,cb->y, 1<<cb->log2Size,1<<cb->log2Size, vec); + /* generate_inter_prediction_samples(ectx, ectx->shdr, ectx->prediction, cb->x,cb->y, // int xC,int yC, 0,0, // int xB,int yB, @@ -87,6 +89,7 @@ 1<<cb->log2Size, 1<<cb->log2Size, // int nPbW,int nPbH, &vec); + */ generate_inter_prediction_samples(ectx, ectx->shdr, ectx->img, cb->x,cb->y, // int xC,int yC, @@ -96,19 +99,31 @@ 1<<cb->log2Size, // int nPbW,int nPbH, &vec); + /* + printBlk("merge prediction:", + ectx->img->get_image_plane_at_pos(0, cb->x,cb->y), 1<<cb->log2Size, + ectx->img->get_image_stride(0), + "merge "); + */ + // estimate rate for sending merge index //CABAC_encoder_estim cabac; //cabac.write_bits(); int IntraSplitFlag = 0; - int MaxTrafoDepth = ectx->sps.max_transform_hierarchy_depth_inter; + int MaxTrafoDepth = ectx->get_sps().max_transform_hierarchy_depth_inter; if (mCodeResidual) { assert(false); + descend(cb,"with residual"); + assert(false); + /* TODO cb->transform_tree = mTBSplit->analyze(ectx,ctxModel, ectx->imgdata->input, NULL, cb, cb->x,cb->y,cb->x,cb->y, cb->log2Size,0, 0, MaxTrafoDepth, IntraSplitFlag); + */ + ascend(); cb->inter.rqt_root_cbf = ! cb->transform_tree->isZeroBlock(); @@ -117,7 +132,7 @@ } else { const de265_image* input = ectx->imgdata->input; - de265_image* img = ectx->prediction; + //de265_image* img = ectx->prediction; int x0 = cb->x; int y0 = cb->y; int tbSize = 1<<cb->log2Size; @@ -126,10 +141,32 @@ cabac.set_context_models(&ctxModel); encode_merge_idx(ectx, &cabac, spec.merge_idx); - cb->distortion = compute_distortion_ssd(input, img, x0,y0, cb->log2Size, 0); + leaf(cb,"no residual"); + cb->rate = cabac.getRDBits(); cb->inter.rqt_root_cbf = 0; + + + enc_tb* tb = new enc_tb(x0,y0,cb->log2Size,cb); + tb->downPtr = &cb->transform_tree; + cb->transform_tree = tb; + + tb->reconstruct(ectx, ectx->img); // reconstruct luma + + /* + printBlk("distortion input:", + input->get_image_plane_at_pos(0,x0,y0), 1<<cb->log2Size, + input->get_image_stride(0), + "input "); + + printBlk("distortion prediction:", + ectx->img->get_image_plane_at_pos(0,x0,y0), 1<<cb->log2Size, + ectx->img->get_image_stride(0), + "pred "); + */ + + cb->distortion = compute_distortion_ssd(input, ectx->img, x0,y0, cb->log2Size, 0); } //printf("%d;%d rqt_root_cbf=%d\n",cb->x,cb->y,cb->inter.rqt_root_cbf);
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/cb-mergeindex.h -> libde265-1.0.3.tar.gz/libde265/encoder/algo/cb-mergeindex.h
Changed
@@ -25,7 +25,6 @@ #include "libde265/nal-parser.h" #include "libde265/decctx.h" -#include "libde265/encoder/encode.h" #include "libde265/slice.h" #include "libde265/scan.h" #include "libde265/intrapred.h" @@ -52,6 +51,8 @@ void setChildAlgo(Algo_TB_Split* algo) { mTBSplit = algo; } // TODO void setInterChildAlgo(Algo_CB_IntraPartMode* algo) { mInterPartModeAlgo = algo; } + virtual const char* name() const { return "cb-mergeindex"; } + protected: Algo_TB_Split* mTBSplit;
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/cb-skip.cc -> libde265-1.0.3.tar.gz/libde265/encoder/algo/cb-skip.cc
Changed
@@ -23,6 +23,7 @@ #include "libde265/encoder/algo/cb-skip.h" #include "libde265/encoder/algo/coding-options.h" +#include "libde265/encoder/encoder-syntax.h" #include "libde265/encoder/encoder-context.h" #include <assert.h> #include <limits> @@ -38,9 +39,11 @@ bool try_skip = (ectx->shdr->slice_type != SLICE_TYPE_I); bool try_nonskip = true; - CodingOptions options(ectx,cb,ctxModel); - CodingOption option_skip = options.new_option(try_skip); - CodingOption option_nonskip = options.new_option(try_nonskip); + //try_nonskip = !try_skip; + + CodingOptions<enc_cb> options(ectx,cb,ctxModel); + CodingOption<enc_cb> option_skip = options.new_option(try_skip); + CodingOption<enc_cb> option_nonskip = options.new_option(try_nonskip); options.start(); for (int i=0;i<CONTEXT_MODEL_TABLE_LENGTH;i++) { @@ -48,10 +51,10 @@ } if (option_skip) { - CodingOption& opt = option_skip; + CodingOption<enc_cb>& opt = option_skip; opt.begin(); - enc_cb* cb = opt.get_cb(); + enc_cb* cb = opt.get_node(); // calc rate for skip flag (=true) @@ -67,18 +70,20 @@ // encode CB + descend(cb,"yes"); cb = mSkipAlgo->analyze(ectx, opt.get_context(), cb); + ascend(); // add rate for PredMode cb->rate += rate_pred_mode; - opt.set_cb(cb); + opt.set_node(cb); opt.end(); } if (option_nonskip) { - CodingOption& opt = option_nonskip; - enc_cb* cb = opt.get_cb(); + CodingOption<enc_cb>& opt = option_nonskip; + enc_cb* cb = opt.get_node(); opt.begin(); @@ -93,14 +98,17 @@ cabac->reset(); } + descend(cb,"no"); cb = mNonSkipAlgo->analyze(ectx, opt.get_context(), cb); + ascend(); + // add rate for PredMode cb->rate += rate_pred_mode; - opt.set_cb(cb); + opt.set_node(cb); opt.end(); } options.compute_rdo_costs(); - return options.return_best_rdo(); + return options.return_best_rdo_node(); }
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/cb-skip.h -> libde265-1.0.3.tar.gz/libde265/encoder/algo/cb-skip.h
Changed
@@ -25,7 +25,6 @@ #include "libde265/nal-parser.h" #include "libde265/decctx.h" -#include "libde265/encoder/encode.h" #include "libde265/slice.h" #include "libde265/scan.h" #include "libde265/intrapred.h" @@ -53,6 +52,8 @@ void setNonSkipAlgo(Algo_CB* algo) { mNonSkipAlgo = algo; } + const char* name() const { return "cb-skip"; } + protected: Algo_CB_MergeIndex* mSkipAlgo; Algo_CB* mNonSkipAlgo; @@ -64,6 +65,8 @@ virtual enc_cb* analyze(encoder_context*, context_model_table&, enc_cb* cb); + + const char* name() const { return "cb-skip-bruteforce"; } }; #endif
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/cb-split.cc -> libde265-1.0.3.tar.gz/libde265/encoder/algo/cb-split.cc
Changed
@@ -24,6 +24,7 @@ #include "libde265/encoder/algo/cb-split.h" #include "libde265/encoder/algo/coding-options.h" #include "libde265/encoder/encoder-context.h" +#include "libde265/encoder/encoder-syntax.h" #include <assert.h> #include <limits> #include <math.h> @@ -46,11 +47,15 @@ // encode all 4 children and sum their distortions and rates for (int i=0;i<4;i++) { + cb->children[i] = NULL; + } + + for (int i=0;i<4;i++) { int child_x = cb->x + ((i&1) << (cb->log2Size-1)); int child_y = cb->y + ((i>>1) << (cb->log2Size-1)); if (child_x>=w || child_y>=h) { - cb->children[i] = NULL; + // NOP } else { enc_cb* childCB = new enc_cb; @@ -59,8 +64,12 @@ childCB->x = child_x; childCB->y = child_y; + childCB->parent = cb; + childCB->downPtr = &cb->children[i]; + descend(cb,"yes %d/4",i+1); cb->children[i] = analyze(ectx, ctxModel, childCB); + ascend(); cb->distortion += cb->children[i]->distortion; cb->rate += cb->children[i]->rate; @@ -81,7 +90,7 @@ // --- prepare coding options --- - const SplitType split_type = get_split_type(&ectx->sps, + const SplitType split_type = get_split_type(&ectx->get_sps(), cb_input->x, cb_input->y, cb_input->log2Size); @@ -92,25 +101,32 @@ //if (can_split_CB) { can_nosplit_CB=false; } // TODO TMP //if (can_nosplit_CB) { can_split_CB=false; } // TODO TMP - CodingOptions options(ectx, cb_input, ctxModel); + CodingOptions<enc_cb> options(ectx, cb_input, ctxModel); - CodingOption option_split = options.new_option(can_split_CB); - CodingOption option_no_split = options.new_option(can_nosplit_CB); + CodingOption<enc_cb> option_no_split = options.new_option(can_nosplit_CB); + CodingOption<enc_cb> option_split = options.new_option(can_split_CB); options.start(); + /* + cb_input->writeSurroundingMetadata(ectx, ectx->img, + enc_node::METADATA_CT_DEPTH, // for estimation cb-split bits + cb_input->get_rectangle()); + */ + // --- encode without splitting --- if (option_no_split) { - CodingOption& opt = option_no_split; // abbrev. + CodingOption<enc_cb>& opt = option_no_split; // abbrev. opt.begin(); - enc_cb* cb = opt.get_cb(); + enc_cb* cb = opt.get_node(); + *cb_input->downPtr = cb; // set CB size in image data-structure - ectx->img->set_ctDepth(cb->x,cb->y,cb->log2Size, cb->ctDepth); - ectx->img->set_log2CbSize(cb->x,cb->y,cb->log2Size, true); + //ectx->img->set_ctDepth(cb->x,cb->y,cb->log2Size, cb->ctDepth); + //ectx->img->set_log2CbSize(cb->x,cb->y,cb->log2Size, true); /* We set QP here, because this is required at in non-split CBs only. */ @@ -118,7 +134,10 @@ // analyze subtree assert(mChildAlgo); + + descend(cb,"no"); cb = mChildAlgo->analyze(ectx, opt.get_context(), cb); + ascend(); // add rate for split flag if (split_type == OptionalSplit) { @@ -126,7 +145,7 @@ cb->rate += opt.get_cabac_rate(); } - opt.set_cb(cb); + opt.set_node(cb); opt.end(); } @@ -135,7 +154,9 @@ if (option_split) { option_split.begin(); - enc_cb* cb = option_split.get_cb(); + enc_cb* cb = option_split.get_node(); + *cb_input->downPtr = cb; + cb = encode_cb_split(ectx, option_split.get_context(), cb); // add rate for split flag @@ -144,12 +165,14 @@ cb->rate += option_split.get_cabac_rate(); } - option_split.set_cb(cb); + option_split.set_node(cb); option_split.end(); } options.compute_rdo_costs(); - enc_cb* bestCB = options.return_best_rdo(); + enc_cb* bestCB = options.return_best_rdo_node(); + + //bestCB->debug_assertTreeConsistency(ectx->img); return bestCB; }
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/cb-split.h -> libde265-1.0.3.tar.gz/libde265/encoder/algo/cb-split.h
Changed
@@ -25,7 +25,6 @@ #include "libde265/nal-parser.h" #include "libde265/decctx.h" -#include "libde265/encoder/encode.h" #include "libde265/slice.h" #include "libde265/scan.h" #include "libde265/intrapred.h" @@ -65,6 +64,8 @@ // has two child algorithms, depending on the coding mode. void setChildAlgo(Algo_CB* algo) { mChildAlgo = algo; } + const char* name() const { return "cb-split"; } + protected: Algo_CB* mChildAlgo; @@ -80,6 +81,8 @@ virtual enc_cb* analyze(encoder_context*, context_model_table&, enc_cb* cb); + + const char* name() const { return "cb-split-bruteforce"; } }; #endif
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/coding-options.cc -> libde265-1.0.3.tar.gz/libde265/encoder/algo/coding-options.cc
Changed
@@ -24,25 +24,28 @@ #include "libde265/encoder/encoder-context.h" -CodingOptions::CodingOptions(encoder_context* ectx, enc_cb* cb, context_model_table& tab) +template <class node> +CodingOptions<node>::CodingOptions(encoder_context* ectx, node* _node, context_model_table& tab) { - mCBInput = cb; + //mCBMode = true; + mInputNode = _node; mContextModelInput = &tab; - mCurrentlyReconstructedOption=-1; mBestRDO=-1; mECtx = ectx; } -CodingOptions::~CodingOptions() +template <class node> +CodingOptions<node>::~CodingOptions() { } -CodingOption CodingOptions::new_option(bool active) +template <class node> +CodingOption<node> CodingOptions<node>::new_option(bool active) { if (!active) { - return CodingOption(); + return CodingOption<node>(); } @@ -50,15 +53,16 @@ bool firstOption = mOptions.empty(); if (firstOption) { - opt.cb = mCBInput; + opt.mNode = mInputNode; } else { - opt.cb = new enc_cb(*mCBInput); + opt.mNode = new node(*mInputNode); } - opt.context = *mContextModelInput; + opt.context = *mContextModelInput; + opt.computed = false; - CodingOption option(this, mOptions.size()); + CodingOption<node> option(this, mOptions.size()); mOptions.push_back( std::move(opt) ); @@ -66,7 +70,8 @@ } -void CodingOptions::start(enum RateEstimationMethod rateMethod) +template <class node> +void CodingOptions<node>::start(enum RateEstimationMethod rateMethod) { /* We don't need the input context model anymore. Releasing it now may save a copy during a later decouple(). @@ -102,33 +107,20 @@ } -void CodingOption::begin() -{ - mParent->cabac->reset(); - mParent->cabac->set_context_models( &get_context() ); - - if (mParent->mCurrentlyReconstructedOption >= 0) { - mParent->mOptions[mParent->mCurrentlyReconstructedOption].cb->save(mParent->mECtx->img); - } - - mParent->mCurrentlyReconstructedOption = mOptionIdx; -} - -void CodingOption::end() -{ - assert(mParent->mCurrentlyReconstructedOption == mOptionIdx); -} - - -void CodingOptions::compute_rdo_costs() +template <class node> +void CodingOptions<node>::compute_rdo_costs() { for (int i=0;i<mOptions.size();i++) { - mOptions[i].rdoCost = mOptions[i].cb->distortion + mECtx->lambda * mOptions[i].cb->rate; + if (mOptions[i].computed) { + //printf("compute_rdo_costs %d: %f\n",i, mOptions[i].mNode->rate); + mOptions[i].rdoCost = mOptions[i].mNode->distortion + mECtx->lambda * mOptions[i].mNode->rate; + } } } -enc_cb* CodingOptions::return_best_rdo() +template <class node> +int CodingOptions<node>::find_best_rdo_index() { assert(mOptions.size()>0); @@ -138,20 +130,29 @@ int bestRDO=-1; for (int i=0;i<mOptions.size();i++) { - float cost = mOptions[i].rdoCost; - if (first || cost < bestRDOCost) { - bestRDOCost = cost; - first = false; - bestRDO = i; + if (mOptions[i].computed) { + float cost = mOptions[i].rdoCost; + + //printf("option %d cost: %f\n",i,cost); + + if (first || cost < bestRDOCost) { + bestRDOCost = cost; + first = false; + bestRDO = i; + } } } + return bestRDO; +} - assert(bestRDO>=0); - if (bestRDO != mCurrentlyReconstructedOption) { - mOptions[bestRDO].cb->restore(mECtx->img); - } +template <class node> +node* CodingOptions<node>::return_best_rdo_node() +{ + int bestRDO = find_best_rdo_index(); + + assert(bestRDO>=0); *mContextModelInput = mOptions[bestRDO].context; @@ -161,10 +162,41 @@ for (int i=0;i<mOptions.size();i++) { if (i != bestRDO) { - delete mOptions[i].cb; - mOptions[i].cb = NULL; + delete mOptions[i].mNode; + mOptions[i].mNode = NULL; } } - return mOptions[bestRDO].cb; + return mOptions[bestRDO].mNode; } + + +template <class node> +void CodingOption<node>::begin() +{ + assert(mParent); + assert(mParent->cabac); // did you call CodingOptions.start() ? + + mParent->cabac->reset(); + mParent->cabac->set_context_models( &get_context() ); + + mParent->mOptions[mOptionIdx].computed = true; + + // link this node into the coding tree + + node* n = get_node(); + *(n->downPtr) = n; +} + + +template <class node> +void CodingOption<node>::end() +{ +} + + +template class CodingOptions<enc_tb>; +template class CodingOptions<enc_cb>; + +template class CodingOption<enc_tb>; +template class CodingOption<enc_cb>;
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/coding-options.h -> libde265-1.0.3.tar.gz/libde265/encoder/algo/coding-options.h
Changed
@@ -23,25 +23,28 @@ #ifndef CODING_OPTIONS_H #define CODING_OPTIONS_H -#include "libde265/encoder/encode.h" +#include "libde265/encoder/encoder-types.h" -class CodingOption; +template <class node> class CodingOption; +template <class node> class CodingOptions { public: - CodingOptions(encoder_context*, enc_cb*, context_model_table& tab); + CodingOptions(encoder_context*, node*, context_model_table& tab); ~CodingOptions(); + typedef CodingOption<node> Option; + // --- init --- call before object use - CodingOption new_option(bool active=true); + CodingOption<node> new_option(bool active=true); enum RateEstimationMethod { - Rate_Default, + Rate_Default, // take default value from encoder_context Rate_AdaptiveContext, Rate_FixedContext }; @@ -58,27 +61,30 @@ // --- end processing --- do not call any function after this one /* Return the CB with the lowest RDO cost. All other CBs are destroyed. - If the current reconstruction and metadata are not from the returned CB, - the data from the returned CB is reconstructed. + If the current metadata stored in the image are not from the returned block, + its metadata flags are set to zero. */ - enc_cb* return_best_rdo(); + node* return_best_rdo_node(); private: struct CodingOptionData { - enc_cb* cb; + node* mNode; + context_model_table context; bool mOptionActive; + bool computed; float rdoCost; }; encoder_context* mECtx; - enc_cb* mCBInput; + bool mCBMode; + node* mInputNode; + context_model_table* mContextModelInput; - int mCurrentlyReconstructedOption; int mBestRDO; std::vector<CodingOptionData> mOptions; @@ -87,10 +93,13 @@ CABAC_encoder_estim_constant cabac_constant; CABAC_encoder_estim* cabac; - friend class CodingOption; + friend class CodingOption<node>; + + int find_best_rdo_index(); }; +template <class node> class CodingOption { public: @@ -99,14 +108,22 @@ mOptionIdx = 0; } - enc_cb* get_cb() { return mParent->mOptions[mOptionIdx].cb; } - void set_cb(enc_cb* cb) { mParent->mOptions[mOptionIdx].cb = cb; } + node* get_node() { return mParent->mOptions[mOptionIdx].mNode; } + void set_node(node* _node) { + if (_node != mParent->mOptions[mOptionIdx].mNode) { + //printf("delete TB %p\n", mParent->mOptions[mOptionIdx].tb); + //delete mParent->mOptions[mOptionIdx].mNode; + } + mParent->mOptions[mOptionIdx].mNode = _node; + } context_model_table& get_context() { return mParent->mOptions[mOptionIdx].context; } + /** @return True if the option is active. + */ operator bool() const { return mParent; } - /* When modifying the reconstruction image or metadata, you have to + /* When modifying the metadata stored in the image, you have to encapsulate the modification between these two functions to ensure that the correct reconstruction will be active after return_best_rdo(). */ @@ -121,13 +138,13 @@ float get_cabac_rate() const { return mParent->cabac->getRDBits(); } private: - CodingOption(class CodingOptions* parent, int idx) + CodingOption(class CodingOptions<node>* parent, int idx) : mParent(parent), mOptionIdx(idx) { } - class CodingOptions* mParent; + class CodingOptions<node>* mParent; int mOptionIdx; - friend class CodingOptions; + friend class CodingOptions<node>; };
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/ctb-qscale.cc -> libde265-1.0.3.tar.gz/libde265/encoder/algo/ctb-qscale.cc
Changed
@@ -33,21 +33,29 @@ enc_cb* Algo_CTB_QScale_Constant::analyze(encoder_context* ectx, context_model_table& ctxModel, - int ctb_x,int ctb_y) + int x,int y) { enc_cb* cb = new enc_cb(); - cb->log2Size = ectx->sps.Log2CtbSizeY; + cb->log2Size = ectx->get_sps().Log2CtbSizeY; cb->ctDepth = 0; - cb->x = ctb_x; - cb->y = ctb_y; + cb->x = x; + cb->y = y; + cb->downPtr = ectx->ctbs.getCTBRootPointer(x,y); + *cb->downPtr = cb; - ectx->img->set_QPY(ctb_x,ctb_y, cb->log2Size, ectx->active_qp); + cb->qp = ectx->active_qp; - // write currently unused coding options to image - ectx->img->set_cu_transquant_bypass(ctb_x,ctb_y,cb->log2Size, cb->cu_transquant_bypass_flag); - ectx->img->set_pcm_flag(ctb_x,ctb_y,cb->log2Size, cb->pcm_flag); + // write currently unused coding options + cb->cu_transquant_bypass_flag = false; + cb->pcm_flag = false; assert(mChildAlgo); - return mChildAlgo->analyze(ectx,ctxModel,cb); + descend(cb, "Q=%d",ectx->active_qp); + enc_cb* result_cb = mChildAlgo->analyze(ectx,ctxModel,cb); + ascend(); + + *cb->downPtr = result_cb; + + return result_cb; }
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/ctb-qscale.h -> libde265-1.0.3.tar.gz/libde265/encoder/algo/ctb-qscale.h
Changed
@@ -25,7 +25,7 @@ #include "libde265/nal-parser.h" #include "libde265/decctx.h" -#include "libde265/encoder/encode.h" +#include "libde265/encoder/algo/algo.h" #include "libde265/slice.h" #include "libde265/scan.h" #include "libde265/intrapred.h" @@ -54,7 +54,7 @@ // ========== choose a qscale at CTB level ========== -class Algo_CTB_QScale +class Algo_CTB_QScale : public Algo { public: Algo_CTB_QScale() : mChildAlgo(NULL) { } @@ -99,6 +99,8 @@ int getQP() const { return mParams.mQP; } + const char* name() const { return "ctb-qscale-constant"; } + private: params mParams; };
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/pb-mv.cc -> libde265-1.0.3.tar.gz/libde265/encoder/algo/pb-mv.cc
Changed
@@ -49,8 +49,8 @@ //printf("%d/%d: [%d;%d] [%d;%d]\n",cb->x,cb->y, mvp[0].x,mvp[0].y, mvp[1].x,mvp[1].y); - motion_spec& spec = cb->inter.pb[PBidx].spec; - MotionVectorSpec& vec = cb->inter.pb[PBidx].motion; + PBMotionCoding& spec = cb->inter.pb[PBidx].spec; + PBMotion& vec = cb->inter.pb[PBidx].motion; spec.merge_flag = 0; spec.merge_idx = 0; @@ -93,6 +93,7 @@ ectx->img->set_mv_info(x,y,w,h, vec); + /* TMP REMOVE: ectx->prediction does not exist anymore generate_inter_prediction_samples(ectx, ectx->shdr, ectx->prediction, cb->x,cb->y, // int xC,int yC, 0,0, // int xB,int yB, @@ -100,18 +101,22 @@ 1<<cb->log2Size, 1<<cb->log2Size, // int nPbW,int nPbH, &vec); + */ // TODO estimate rate for sending MV int IntraSplitFlag = 0; - int MaxTrafoDepth = ectx->sps.max_transform_hierarchy_depth_inter; + int MaxTrafoDepth = ectx->get_sps().max_transform_hierarchy_depth_inter; mCodeResidual=true; if (mCodeResidual) { assert(mTBSplitAlgo); + assert(false); + /* cb->transform_tree = mTBSplitAlgo->analyze(ectx,ctxModel, ectx->imgdata->input, NULL, cb, cb->x,cb->y,cb->x,cb->y, cb->log2Size,0, 0, MaxTrafoDepth, IntraSplitFlag); + */ cb->inter.rqt_root_cbf = ! cb->transform_tree->isZeroBlock(); @@ -120,6 +125,7 @@ } else { const de265_image* input = ectx->imgdata->input; + /* TODO TMP REMOVE: prediction does not exist anymore de265_image* img = ectx->prediction; int x0 = cb->x; int y0 = cb->y; @@ -129,6 +135,7 @@ cb->rate = 5; // fake (MV) cb->inter.rqt_root_cbf = 0; + */ } return cb; @@ -174,8 +181,8 @@ 0, 0, // int refIdx, int partIdx, mvp); - motion_spec& spec = cb->inter.pb[PBidx].spec; - MotionVectorSpec& vec = cb->inter.pb[PBidx].motion; + PBMotionCoding& spec = cb->inter.pb[PBidx].spec; + PBMotion& vec = cb->inter.pb[PBidx].motion; spec.merge_flag = 0; spec.merge_idx = 0; @@ -258,6 +265,7 @@ ectx->img->set_mv_info(x,y,pbW,pbH, vec); + /* TMP REMOVE: ectx->prediction does not exist anymore generate_inter_prediction_samples(ectx, ectx->shdr, ectx->prediction, cb->x,cb->y, // int xC,int yC, 0,0, // int xB,int yB, @@ -265,6 +273,7 @@ 1<<cb->log2Size, 1<<cb->log2Size, // int nPbW,int nPbH, &vec); + */ // --- create residual --- @@ -273,13 +282,16 @@ // TODO estimate rate for sending MV int IntraSplitFlag = 0; - int MaxTrafoDepth = ectx->sps.max_transform_hierarchy_depth_inter; + int MaxTrafoDepth = ectx->get_sps().max_transform_hierarchy_depth_inter; mCodeResidual=true; if (mCodeResidual) { + assert(false); + /* cb->transform_tree = mTBSplitAlgo->analyze(ectx,ctxModel, ectx->imgdata->input, NULL, cb, cb->x,cb->y,cb->x,cb->y, cb->log2Size,0, 0, MaxTrafoDepth, IntraSplitFlag); + */ cb->inter.rqt_root_cbf = ! cb->transform_tree->isZeroBlock();
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/pb-mv.h -> libde265-1.0.3.tar.gz/libde265/encoder/algo/pb-mv.h
Changed
@@ -25,7 +25,6 @@ #include "libde265/nal-parser.h" #include "libde265/decctx.h" -#include "libde265/encoder/encode.h" #include "libde265/slice.h" #include "libde265/scan.h" #include "libde265/intrapred.h"
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/tb-intrapredmode.cc -> libde265-1.0.3.tar.gz/libde265/encoder/algo/tb-intrapredmode.cc
Changed
@@ -21,9 +21,9 @@ */ -#include "libde265/encoder/analyze.h" #include "libde265/encoder/encoder-context.h" #include "libde265/encoder/algo/tb-split.h" +#include "libde265/encoder/algo/coding-options.h" #include <assert.h> #include <limits> #include <math.h> @@ -31,65 +31,38 @@ #include <iostream> -enum IntraPredMode find_best_intra_mode(de265_image& img,int x0,int y0, int log2BlkSize, int cIdx, - const uint8_t* ref, int stride) +float get_intra_pred_mode_bits(const enum IntraPredMode candidates[3], + enum IntraPredMode intraMode, + enum IntraPredMode intraModeC, + context_model_table& context_models, + bool includeChroma) { - //return INTRA_ANGULAR_20; + float rate; + int enc_bin; - enum IntraPredMode best_mode; - int min_sad=-1; + /**/ if (candidates[0]==intraMode) { rate = 1; enc_bin=1; } + else if (candidates[1]==intraMode) { rate = 2; enc_bin=1; } + else if (candidates[2]==intraMode) { rate = 2; enc_bin=1; } + else { rate = 5; enc_bin=0; } - int candidates[3]; + CABAC_encoder_estim estim; + estim.set_context_models(&context_models); + logtrace(LogSymbols,"$1 prev_intra_luma_pred_flag=%d\n",enc_bin); + estim.write_CABAC_bit(CONTEXT_MODEL_PREV_INTRA_LUMA_PRED_FLAG, enc_bin); - const seq_parameter_set* sps = &img.sps; + // TODO: currently we make the chroma-pred-mode decision for each part even + // in NxN part mode. Since we always set this to the same value, it does not + // matter. However, we should only add the rate for it once (for blkIdx=0). + if (includeChroma) { + assert(intraMode == intraModeC); - fillIntraPredModeCandidates(candidates, x0,y0, - sps->getPUIndexRS(x0,y0), - x0>0, y0>0, &img); - - // --- test candidates first --- - - for (int idx=0;idx<3;idx++) { - enum IntraPredMode mode = (enum IntraPredMode)candidates[idx]; - decode_intra_prediction(&img, x0,y0, (enum IntraPredMode)mode, 1<<log2BlkSize, cIdx); - - uint32_t distortion = SSD(ref,stride, - img.get_image_plane_at_pos(cIdx, x0,y0), img.get_image_stride(cIdx), - 1<<log2BlkSize, 1<<log2BlkSize); - - int sad=distortion; - - sad *= 0.5; - //sad *= 0.9; - - if (mode==0 || sad<min_sad) { - min_sad = sad; - best_mode = (enum IntraPredMode)mode; - } + logtrace(LogSymbols,"$1 intra_chroma_pred_mode=%d\n",0); + estim.write_CABAC_bit(CONTEXT_MODEL_INTRA_CHROMA_PRED_MODE,0); } + rate += estim.getRDBits(); - - // --- test all modes --- - - for (int idx=0;idx<35;idx++) { - enum IntraPredMode mode = (enum IntraPredMode)idx; //candidates[idx]; - decode_intra_prediction(&img, x0,y0, (enum IntraPredMode)mode, 1<<log2BlkSize, cIdx); - - - uint32_t distortion = SSD(ref,stride, - img.get_image_plane_at_pos(cIdx, x0,y0), img.get_image_stride(cIdx), - 1<<log2BlkSize, 1<<log2BlkSize); - - int sad=distortion; - - if (min_sad<0 || sad<min_sad) { - min_sad = sad; - best_mode = (enum IntraPredMode)mode; - } - } - - return best_mode; + return rate; } @@ -97,10 +70,12 @@ float estim_TB_bitrate(const encoder_context* ectx, const de265_image* input, - int x0,int y0, int log2BlkSize, + const enc_tb* tb, enum TBBitrateEstimMethod method) { - int blkSize = 1<<log2BlkSize; + int x0 = tb->x; + int y0 = tb->y; + int blkSize = 1 << tb->log2Size; float distortion; @@ -109,35 +84,68 @@ case TBBitrateEstim_SSD: return SSD(input->get_image_plane_at_pos(0, x0,y0), input->get_image_stride(0), - ectx->img->get_image_plane_at_pos(0, x0,y0), - ectx->img->get_image_stride(0), - 1<<log2BlkSize, 1<<log2BlkSize); + tb->intra_prediction[0]->get_buffer_u8(), + tb->intra_prediction[0]->getStride(), + blkSize, blkSize); break; case TBBitrateEstim_SAD: return SAD(input->get_image_plane_at_pos(0, x0,y0), input->get_image_stride(0), - ectx->img->get_image_plane_at_pos(0, x0,y0), - ectx->img->get_image_stride(0), - 1<<log2BlkSize, 1<<log2BlkSize); + tb->intra_prediction[0]->get_buffer_u8(), + tb->intra_prediction[0]->getStride(), + blkSize, blkSize); break; case TBBitrateEstim_SATD_DCT: case TBBitrateEstim_SATD_Hadamard: { - int16_t coeffs[32*32]; - int16_t diff[32*32]; + int16_t coeffs[64*64]; + int16_t diff[64*64]; + + // Usually, TBs are max. 32x32 big. However, it may be that this is still called + // for 64x64 blocks, because we are sometimes computing an intra pred mode for a + // whole CTB at once. + assert(blkSize <= 64); diff_blk(diff,blkSize, input->get_image_plane_at_pos(0, x0,y0), input->get_image_stride(0), - ectx->img->get_image_plane_at_pos(0, x0,y0), ectx->img->get_image_stride(0), + tb->intra_prediction[0]->get_buffer_u8(), + tb->intra_prediction[0]->getStride(), blkSize); - if (method == TBBitrateEstim_SATD_Hadamard) { - ectx->acceleration.hadamard_transform_8[log2BlkSize-2](coeffs, diff, &diff[blkSize] - &diff[0]); + void (*transform)(int16_t *coeffs, const int16_t *src, ptrdiff_t stride); + + + if (tb->log2Size == 6) { + // hack for 64x64 blocks: compute 4 times 32x32 blocks + + if (method == TBBitrateEstim_SATD_Hadamard) { + transform = ectx->acceleration.hadamard_transform_8[6-1-2]; + + transform(coeffs, &diff[0 ], 64); + transform(coeffs+1*32*32, &diff[32 ], 64); + transform(coeffs+2*32*32, &diff[32*64 ], 64); + transform(coeffs+3*32*32, &diff[32*64+32], 64); + } + else { + transform = ectx->acceleration.fwd_transform_8[6-1-2]; + + transform(coeffs, &diff[0 ], 64); + transform(coeffs+1*32*32, &diff[32 ], 64); + transform(coeffs+2*32*32, &diff[32*64 ], 64); + transform(coeffs+3*32*32, &diff[32*64+32], 64); + } } else { - ectx->acceleration.fwd_transform_8[log2BlkSize-2](coeffs, diff, &diff[blkSize] - &diff[0]); + assert(tb->log2Size-2 <= 3); + + if (method == TBBitrateEstim_SATD_Hadamard) { + ectx->acceleration.hadamard_transform_8[tb->log2Size-2](coeffs, diff, &diff[blkSize] - &diff[0]); + } + else { + ectx->acceleration.fwd_transform_8[tb->log2Size-2](coeffs, diff, &diff[blkSize] - &diff[0]); + } } float distortion=0; @@ -166,119 +174,99 @@ Algo_TB_IntraPredMode_BruteForce::analyze(encoder_context* ectx, context_model_table& ctxModel,
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/tb-intrapredmode.h -> libde265-1.0.3.tar.gz/libde265/encoder/algo/tb-intrapredmode.h
Changed
@@ -25,7 +25,8 @@ #include "libde265/nal-parser.h" #include "libde265/decctx.h" -#include "libde265/encoder/encode.h" +#include "libde265/encoder/encoder-types.h" +#include "libde265/encoder/algo/algo.h" #include "libde265/slice.h" #include "libde265/scan.h" #include "libde265/intrapred.h" @@ -36,20 +37,6 @@ #include "libde265/configparam.h" -/* Encoder search tree, bottom up: - - - Algo_TB_Split - whether TB is split or not - - - Algo_TB_IntraPredMode - choose the intra prediction mode (or NOP, if at the wrong tree level) - - - Algo_CB_IntraPartMode - choose between NxN and 2Nx2N intra parts - - - Algo_CB_Split - whether CB is split or not - - - Algo_CTB_QScale - select QScale on CTB granularity - */ - - // ========== TB intra prediction mode ========== enum ALGO_TB_IntraPredMode { @@ -94,7 +81,7 @@ /** Base class for intra prediction-mode algorithms. Selects one of the 35 prediction modes. */ -class Algo_TB_IntraPredMode +class Algo_TB_IntraPredMode : public Algo { public: Algo_TB_IntraPredMode() : mTBSplitAlgo(NULL) { } @@ -103,14 +90,13 @@ virtual enc_tb* analyze(encoder_context*, context_model_table&, const de265_image* input, - const enc_tb* parent, - enc_cb* cb, - int x0,int y0, int xBase,int yBase, int log2TbSize, - int blkIdx, + enc_tb* tb, int TrafoDepth, int MaxTrafoDepth, int IntraSplitFlag) = 0; void setChildAlgo(Algo_TB_Split* algo) { mTBSplitAlgo = algo; } + const char* name() const { return "tb-intrapredmode"; } + protected: Algo_TB_Split* mTBSplitAlgo; }; @@ -141,26 +127,41 @@ { public: Algo_TB_IntraPredMode_ModeSubset() { + enableAllIntraPredModes(); + } + + void enableAllIntraPredModes() { for (int i=0;i<35;i++) { mPredMode_enabled[i] = true; + mPredMode[i] = (enum IntraPredMode)i; } + + mNumPredModesEnabled = 35; } void disableAllIntraPredModes() { for (int i=0;i<35;i++) { mPredMode_enabled[i] = false; } + + mNumPredModesEnabled = 0; } - void enableIntraPredMode(int mode, bool flag=true) { - mPredMode_enabled[mode] = flag; + void enableIntraPredMode(enum IntraPredMode mode) { + if (!mPredMode_enabled[mode]) { + mPredMode[mNumPredModesEnabled] = mode; + mPredMode_enabled[mode] = true; + mNumPredModesEnabled++; + } } + // TODO: method to disable modes + void enableIntraPredModeSubset(enum ALGO_TB_IntraPredMode_Subset subset) { switch (subset) { case ALGO_TB_IntraPredMode_Subset_All: // activate all is the default - for (int i=0;i<35;i++) { enableIntraPredMode(i); } + for (int i=0;i<35;i++) { enableIntraPredMode((enum IntraPredMode)i); } break; case ALGO_TB_IntraPredMode_Subset_DC: disableAllIntraPredModes(); @@ -180,8 +181,24 @@ } } - protected: + + enum IntraPredMode getPredMode(int idx) const { + assert(idx<mNumPredModesEnabled); + return mPredMode[idx]; + } + + int nPredModesEnabled() const { + return mNumPredModesEnabled; + } + + bool isPredModeEnabled(enum IntraPredMode mode) { + return mPredMode_enabled[mode]; + } + + private: + IntraPredMode mPredMode[35]; bool mPredMode_enabled[35]; + int mNumPredModesEnabled; }; @@ -194,11 +211,11 @@ virtual enc_tb* analyze(encoder_context*, context_model_table&, const de265_image* input, - const enc_tb* parent, - enc_cb* cb, - int x0,int y0, int xBase,int yBase, int log2TbSize, - int blkIdx, + enc_tb* tb, int TrafoDepth, int MaxTrafoDepth, int IntraSplitFlag); + + + const char* name() const { return "tb-intrapredmode_BruteForce"; } }; @@ -233,12 +250,12 @@ virtual enc_tb* analyze(encoder_context*, context_model_table&, const de265_image* input, - const enc_tb* parent, - enc_cb* cb, - int x0,int y0, int xBase,int yBase, int log2TbSize, - int blkIdx, + enc_tb* tb, int TrafoDepth, int MaxTrafoDepth, int IntraSplitFlag); + + const char* name() const { return "tb-intrapredmode_FastBrute"; } + private: params mParams; }; @@ -265,14 +282,13 @@ config.add_option(&mParams.bitrateEstimMethod); } - virtual enc_tb* analyze(encoder_context*, - context_model_table&, - const de265_image* input, - const enc_tb* parent, - enc_cb* cb, - int x0,int y0, int xBase,int yBase, int log2TbSize, - int blkIdx, - int TrafoDepth, int MaxTrafoDepth, int IntraSplitFlag); + enc_tb* analyze(encoder_context*, + context_model_table&, + const de265_image* input, + enc_tb* tb, + int TrafoDepth, int MaxTrafoDepth, int IntraSplitFlag); + + const char* name() const { return "tb-intrapredmode_MinResidual"; } private: params mParams;
View file
libde265-1.0.3.tar.gz/libde265/encoder/algo/tb-rateestim.cc
Added
@@ -0,0 +1,46 @@ +/* + * H.265 video codec. + * Copyright (c) 2013-2014 struktur AG, Dirk Farin <farin@struktur.de> + * + * Authors: struktur AG, Dirk Farin <farin@struktur.de> + * + * This file is part of libde265. + * + * libde265 is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * libde265 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with libde265. If not, see <http://www.gnu.org/licenses/>. + */ + + +#include "libde265/encoder/algo/tb-rateestim.h" +#include "libde265/encoder/encoder-syntax.h" +#include <assert.h> +#include <iostream> + + +float Algo_TB_RateEstimation_Exact::encode_transform_unit(encoder_context* ectx, + context_model_table& ctxModel, + const enc_tb* tb, const enc_cb* cb, + int x0,int y0, int xBase,int yBase, + int log2TrafoSize, int trafoDepth, + int blkIdx) +{ + CABAC_encoder_estim estim; + estim.set_context_models(&ctxModel); + + leaf(cb, NULL); + + ::encode_transform_unit(ectx, &estim, tb,cb, x0,y0, xBase,yBase, + log2TrafoSize, trafoDepth, blkIdx); + + return estim.getRDBits(); +}
View file
libde265-1.0.3.tar.gz/libde265/encoder/algo/tb-rateestim.h
Added
@@ -0,0 +1,101 @@ +/* + * H.265 video codec. + * Copyright (c) 2013-2014 struktur AG, Dirk Farin <farin@struktur.de> + * + * Authors: Dirk Farin <farin@struktur.de> + * + * This file is part of libde265. + * + * libde265 is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * libde265 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with libde265. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef TB_RATEESTIM_H +#define TB_RATEESTIM_H + +#include "libde265/nal-parser.h" +#include "libde265/decctx.h" +#include "libde265/encoder/encoder-types.h" +#include "libde265/encoder/algo/algo.h" +#include "libde265/slice.h" +#include "libde265/scan.h" +#include "libde265/intrapred.h" +#include "libde265/transform.h" +#include "libde265/fallback-dct.h" +#include "libde265/quality.h" +#include "libde265/fallback.h" +#include "libde265/configparam.h" + + +enum ALGO_TB_RateEstimation { + ALGO_TB_RateEstimation_None, + ALGO_TB_RateEstimation_Exact +}; + +class option_ALGO_TB_RateEstimation : public choice_option<enum ALGO_TB_RateEstimation> +{ + public: + option_ALGO_TB_RateEstimation() { + add_choice("none" ,ALGO_TB_RateEstimation_None); + add_choice("exact",ALGO_TB_RateEstimation_Exact, true); + } +}; + + + +class Algo_TB_RateEstimation : public Algo +{ + public: + virtual ~Algo_TB_RateEstimation() { } + + virtual float encode_transform_unit(encoder_context* ectx, + context_model_table& ctxModel, + const enc_tb* tb, const enc_cb* cb, + int x0,int y0, int xBase,int yBase, + int log2TrafoSize, int trafoDepth, int blkIdx) = 0; + + virtual const char* name() const { return "tb-rateestimation"; } +}; + + +class Algo_TB_RateEstimation_None : public Algo_TB_RateEstimation +{ + public: + virtual float encode_transform_unit(encoder_context* ectx, + context_model_table& ctxModel, + const enc_tb* tb, const enc_cb* cb, + int x0,int y0, int xBase,int yBase, + int log2TrafoSize, int trafoDepth, int blkIdx) + { + leaf(cb, NULL); + return 0.0f; + } + + virtual const char* name() const { return "tb-rateestimation-none"; } +}; + + +class Algo_TB_RateEstimation_Exact : public Algo_TB_RateEstimation +{ + public: + virtual float encode_transform_unit(encoder_context* ectx, + context_model_table& ctxModel, + const enc_tb* tb, const enc_cb* cb, + int x0,int y0, int xBase,int yBase, + int log2TrafoSize, int trafoDepth, int blkIdx); + + virtual const char* name() const { return "tb-rateestimation-exact"; } +}; + + +#endif
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/tb-split.cc -> libde265-1.0.3.tar.gz/libde265/encoder/algo/tb-split.cc
Changed
@@ -21,329 +21,322 @@ */ -#include "libde265/encoder/analyze.h" +#include "libde265/encoder/encoder-core.h" #include "libde265/encoder/encoder-context.h" +#include "libde265/encoder/encoder-syntax.h" +#include "libde265/encoder/algo/coding-options.h" #include <assert.h> #include <limits> #include <math.h> #include <iostream> -#define ENCODER_DEVELOPMENT 1 - - -void diff_blk(int16_t* out,int out_stride, - const uint8_t* a_ptr, int a_stride, - const uint8_t* b_ptr, int b_stride, - int blkSize) -{ - for (int by=0;by<blkSize;by++) - for (int bx=0;bx<blkSize;bx++) - { - out[by*out_stride+bx] = a_ptr[by*a_stride+bx] - b_ptr[by*b_stride+bx]; - } -} - - -static bool has_nonzero_value(const int16_t* data, int n) +struct Logging_TB_Split : public Logging { - for (int i=0;i<n;i++) - if (data[i]) return true; - - return false; -} - + int skipTBSplit, noskipTBSplit; + int zeroBlockCorrelation[6][2][5]; -void show_debug_image(const de265_image* input, int slot); + const char* name() const { return "tb-split"; } -/* - void encode_transform_unit(encoder_context* ectx, - enc_tb* tb, - const de265_image* input, - //int16_t* residual, int stride, - int x0,int y0, // luma position - int log2TbSize, // chroma adapted - const enc_cb* cb, - int cIdx) + void print(const encoder_context* ectx, const char* filename) { - } -*/ - -void analyze_transform_unit(encoder_context* ectx, - enc_tb* tb, - const de265_image* input, // TODO: probably pass pixels/stride directly - //int16_t* residual, int stride, - int x0,int y0, // luma position - int log2TbSize, // chroma adapted - const enc_cb* cb, - int cIdx) -{ - int xC = x0; - int yC = y0; - int tbSize = 1<<log2TbSize; - if (cIdx>0) { xC>>=1; yC>>=1; } - - enum PredMode predMode = cb->PredMode; - - int16_t blk[32*32]; // residual - - // --- do intra prediction --- + for (int tb=3;tb<=5;tb++) { + for (int z=0;z<=1;z++) { + float total = 0; - if (predMode==MODE_INTRA) { - enum IntraPredMode intraPredMode; + for (int c=0;c<5;c++) + total += zeroBlockCorrelation[tb][z][c]; - if (cIdx==0) { - intraPredMode = ectx->img->get_IntraPredMode(x0,y0); - } - else { - intraPredMode = cb->intra.chroma_mode; + for (int c=0;c<5;c++) { + printf("%d %d %d : %d %5.2f\n", tb,z,c, + zeroBlockCorrelation[tb][z][c], + total==0 ? 0 : zeroBlockCorrelation[tb][z][c]/total*100); + } + } } - decode_intra_prediction(ectx->img, xC, yC, intraPredMode, tbSize , cIdx); - - // --- subtract prediction from prediction --- - - uint8_t* pred = ectx->img->get_image_plane(cIdx); - int stride = ectx->img->get_image_stride(cIdx); - - diff_blk(blk,tbSize, - input->get_image_plane_at_pos(cIdx,xC,yC), input->get_image_stride(cIdx), - &pred[yC*stride+xC],stride, tbSize); - } - else { - // --- subtract prediction from prediction --- - - uint8_t* pred = ectx->prediction->get_image_plane(cIdx); - int stride = ectx->prediction->get_image_stride(cIdx); + for (int z=0;z<2;z++) { + printf("\n"); + for (int tb=3;tb<=5;tb++) { + float total = 0; - //printBlk("input",input->get_image_plane_at_pos(cIdx,xC,yC), tbSize, input->get_image_stride(cIdx)); - //printBlk("prediction", pred,tbSize, stride); + for (int c=0;c<5;c++) + total += zeroBlockCorrelation[tb][z][c]; - diff_blk(blk,tbSize, - input->get_image_plane_at_pos(cIdx,xC,yC), input->get_image_stride(cIdx), - &pred[yC*stride+xC],stride, tbSize); + printf("%dx%d ",1<<tb,1<<tb); - //printBlk("residual", blk,tbSize,tbSize); + for (int c=0;c<5;c++) { + printf("%5.2f ", total==0 ? 0 : zeroBlockCorrelation[tb][z][c]/total*100); + } + printf("\n"); + } + } } +} logging_tb_split; - //show_debug_image(ectx->img, 0); - +template <class pixel_t> +void diff_blk(int16_t* out,int out_stride, + const pixel_t* a_ptr, int a_stride, + const pixel_t* b_ptr, int b_stride, + int blkSize) +{ + for (int by=0;by<blkSize;by++) + for (int bx=0;bx<blkSize;bx++) + { + out[by*out_stride+bx] = a_ptr[by*a_stride+bx] - b_ptr[by*b_stride+bx]; + } +} +template <class pixel_t> +void compute_residual_channel(encoder_context* ectx, enc_tb* tb, const de265_image* input, + int cIdx, int x,int y,int log2Size) +{ + int blkSize = (1<<log2Size); - // --- forward transform --- + enum IntraPredMode mode; - tb->alloc_coeff_memory(cIdx, tbSize); + if (cIdx==0) { + mode = tb->intra_mode; + } + else { + mode = tb->intra_mode_chroma; + } - int trType; - if (cIdx==0 && log2TbSize==2 && predMode==MODE_INTRA) trType=1; // TODO: inter mode - else trType=0; + // decode intra prediction - fwd_transform(&ectx->acceleration, tb->coeff[cIdx], tbSize, log2TbSize, trType, blk, tbSize); + tb->intra_prediction[cIdx] = std::make_shared<small_image_buffer>(log2Size, sizeof(pixel_t)); + decode_intra_prediction_from_tree(ectx->img, tb, ectx->ctbs, ectx->get_sps(), cIdx); - // --- quantization --- + // create residual buffer and compute differences - quant_coefficients(tb->coeff[cIdx], tb->coeff[cIdx], log2TbSize, cb->qp, true); + tb->residual[cIdx] = std::make_shared<small_image_buffer>(log2Size, sizeof(int16_t)); - tb->cbf[cIdx] = has_nonzero_value(tb->coeff[cIdx], 1<<(log2TbSize<<1)); + diff_blk<pixel_t>(tb->residual[cIdx]->get_buffer_s16(), blkSize, + input->get_image_plane_at_pos(cIdx,x,y), + input->get_image_stride(cIdx), + tb->intra_prediction[cIdx]->get_buffer<pixel_t>(), blkSize, + blkSize); }
View file
libde265-1.0.2.tar.gz/libde265/encoder/algo/tb-split.h -> libde265-1.0.3.tar.gz/libde265/encoder/algo/tb-split.h
Changed
@@ -25,7 +25,8 @@ #include "libde265/nal-parser.h" #include "libde265/decctx.h" -#include "libde265/encoder/encode.h" +#include "libde265/encoder/encoder-types.h" +#include "libde265/encoder/algo/algo.h" #include "libde265/slice.h" #include "libde265/scan.h" #include "libde265/intrapred.h" @@ -36,64 +37,37 @@ #include "libde265/configparam.h" #include "libde265/encoder/algo/tb-intrapredmode.h" - - -/* Encoder search tree, bottom up: - - - Algo_TB_Split - whether TB is split or not - - - Algo_TB_IntraPredMode - choose the intra prediction mode (or NOP, if at the wrong tree level) - - - Algo_CB_IntraPartMode - choose between NxN and 2Nx2N intra parts - - - Algo_CB_Split - whether CB is split or not - - - Algo_CTB_QScale - select QScale on CTB granularity - */ - -/* -struct ResidualBlock -{ - const int16_t* data[4]; - int stride[4]; -}; -*/ - -void diff_blk(int16_t* out,int out_stride, - const uint8_t* a_ptr, int a_stride, - const uint8_t* b_ptr, int b_stride, - int blkSize); +#include "libde265/encoder/algo/tb-rateestim.h" +#include "libde265/encoder/algo/tb-transform.h" // ========== TB split decision ========== -class Algo_TB_Split +class Algo_TB_Split : public Algo { public: - Algo_TB_Split() : mAlgo_TB_IntraPredMode(NULL) { } + Algo_TB_Split() : mAlgo_TB_IntraPredMode(NULL) { } virtual ~Algo_TB_Split() { } virtual enc_tb* analyze(encoder_context*, context_model_table&, const de265_image* input, - const enc_tb* parent, - enc_cb* cb, - int x0,int y0, int xBase,int yBase, int log2TbSize, - int blkIdx, + enc_tb* tb, int TrafoDepth, int MaxTrafoDepth, int IntraSplitFlag) = 0; void setAlgo_TB_IntraPredMode(Algo_TB_IntraPredMode* algo) { mAlgo_TB_IntraPredMode=algo; } + void setAlgo_TB_Residual(Algo_TB_Residual* algo) { mAlgo_TB_Residual=algo; } protected: enc_tb* encode_transform_tree_split(encoder_context* ectx, context_model_table& ctxModel, const de265_image* input, - const enc_tb* parent, + enc_tb* tb, enc_cb* cb, - int x0,int y0, int log2TbSize, int TrafoDepth, int MaxTrafoDepth, int IntraSplitFlag); Algo_TB_IntraPredMode* mAlgo_TB_IntraPredMode; + Algo_TB_Residual* mAlgo_TB_Residual; }; @@ -118,6 +92,7 @@ } }; + class Algo_TB_Split_BruteForce : public Algo_TB_Split { public: @@ -139,12 +114,11 @@ virtual enc_tb* analyze(encoder_context*, context_model_table&, const de265_image* input, - const enc_tb* parent, - enc_cb* cb, - int x0,int y0, int xBase,int yBase, int log2TbSize, - int blkIdx, + enc_tb* tb, int TrafoDepth, int MaxTrafoDepth, int IntraSplitFlag); + const char* name() const { return "tb-split-bruteforce"; } + private: params mParams; };
View file
libde265-1.0.3.tar.gz/libde265/encoder/algo/tb-transform.cc
Added
@@ -0,0 +1,254 @@ +/* + * H.265 video codec. + * Copyright (c) 2013-2014 struktur AG, Dirk Farin <farin@struktur.de> + * + * Authors: struktur AG, Dirk Farin <farin@struktur.de> + * + * This file is part of libde265. + * + * libde265 is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * libde265 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with libde265. If not, see <http://www.gnu.org/licenses/>. + */ + + +#include "libde265/encoder/algo/tb-transform.h" +#include "libde265/encoder/encoder-core.h" +#include "libde265/encoder/encoder-context.h" +#include "libde265/encoder/encoder-syntax.h" +#include <assert.h> +#include <limits> +#include <math.h> +#include <iostream> + + +// DEPRECATED IN THIS FILE +void diff_blk(int16_t* out,int out_stride, + const uint8_t* a_ptr, int a_stride, + const uint8_t* b_ptr, int b_stride, + int blkSize) +{ + for (int by=0;by<blkSize;by++) + for (int bx=0;bx<blkSize;bx++) + { + out[by*out_stride+bx] = a_ptr[by*a_stride+bx] - b_ptr[by*b_stride+bx]; + } +} + + +static bool has_nonzero_value(const int16_t* data, int n) +{ + for (int i=0;i<n;i++) + if (data[i]) return true; + + return false; +} + + +void compute_transform_coeffs(encoder_context* ectx, + enc_tb* tb, + const de265_image* input, // TODO: probably pass pixels/stride directly + //int16_t* residual, int stride, + int x0,int y0, // luma position + int log2TbSize, // chroma adapted + const enc_cb* cb, + int cIdx) +{ + int xC = x0; + int yC = y0; + int tbSize = 1<<log2TbSize; + if (cIdx>0) { xC>>=1; yC>>=1; } + + enum PredMode predMode = cb->PredMode; + + int16_t blk[32*32]; // residual + int16_t* residual; + + + //printf("transform-coeffs %d;%d size:%d cIdx:%d\n", tb->x,tb->y,1<<tb->log2Size,cIdx); + + // --- do intra prediction --- + + if (predMode==MODE_INTRA) { + residual = tb->residual[cIdx]->get_buffer_s16(); + + //printf("intra residual: %p stride: %d\n",residual, tb->residual[cIdx]->get_stride()); + } + else { + // --- subtract prediction from input image --- + + /* TMP REMOVE: ectx->prediction does not exist anymore + + uint8_t* pred = ectx->prediction->get_image_plane(cIdx); + int stride = ectx->prediction->get_image_stride(cIdx); + + //printBlk("input",input->get_image_plane_at_pos(cIdx,xC,yC), tbSize, input->get_image_stride(cIdx)); + //printBlk("prediction", pred,tbSize, stride); + + diff_blk(blk,tbSize, + input->get_image_plane_at_pos(cIdx,xC,yC), input->get_image_stride(cIdx), + &pred[yC*stride+xC],stride, tbSize); + + residual=blk; + */ + + //printBlk("residual", blk,tbSize,tbSize); + } + + + + + + // --- forward transform --- + + tb->alloc_coeff_memory(cIdx, tbSize); + + + // transformation mode (DST or DCT) + + int trType; + if (cIdx==0 && log2TbSize==2 && predMode==MODE_INTRA) trType=1; // TODO: inter mode + else trType=0; + + + // do forward transform + + fwd_transform(&ectx->acceleration, tb->coeff[cIdx], tbSize, log2TbSize, trType, residual, tbSize); + + + // --- quantization --- + + quant_coefficients(tb->coeff[cIdx], tb->coeff[cIdx], log2TbSize, cb->qp, true); + + + // set CBF to 0 if there are no non-zero coefficients + + tb->cbf[cIdx] = has_nonzero_value(tb->coeff[cIdx], 1<<(log2TbSize<<1)); +} + + +enc_tb* Algo_TB_Transform::analyze(encoder_context* ectx, + context_model_table& ctxModel, + const de265_image* input, + enc_tb* tb, + int trafoDepth, int MaxTrafoDepth, + int IntraSplitFlag) +{ + enter(); + + const enc_cb* cb = tb->cb; + *tb->downPtr = tb; // TODO: should be obsolet + + de265_image* img = ectx->img; + + int stride = ectx->img->get_image_stride(0); + + uint8_t* luma_plane = ectx->img->get_image_plane(0); + uint8_t* cb_plane = ectx->img->get_image_plane(1); + uint8_t* cr_plane = ectx->img->get_image_plane(2); + + // --- compute transform coefficients --- + + int x0 = tb->x; + int y0 = tb->y; + int xBase = cb->x; + int yBase = cb->y; + int log2TbSize = tb->log2Size; + + // luma block + + compute_transform_coeffs(ectx, tb, input, x0,y0, log2TbSize, cb, 0 /* Y */); + + + // chroma blocks + + if (ectx->get_sps().chroma_format_idc == CHROMA_444) { + compute_transform_coeffs(ectx, tb, input, x0,y0, log2TbSize, cb, 1 /* Cb */); + compute_transform_coeffs(ectx, tb, input, x0,y0, log2TbSize, cb, 2 /* Cr */); + } + else if (log2TbSize > 2) { + // if TB is > 4x4, do chroma transform of half size + compute_transform_coeffs(ectx, tb, input, x0,y0, log2TbSize-1, cb, 1 /* Cb */); + compute_transform_coeffs(ectx, tb, input, x0,y0, log2TbSize-1, cb, 2 /* Cr */); + } + else if (tb->blkIdx==3) { + // if TB size is 4x4, do chroma transform for last sub-block + compute_transform_coeffs(ectx, tb, input, xBase,yBase, log2TbSize, cb, 1 /* Cb */); + compute_transform_coeffs(ectx, tb, input, xBase,yBase, log2TbSize, cb, 2 /* Cr */); + } + + + // --- reconstruction --- + + /* We could compute the reconstruction lazy on first access. However, we currently + use it right away for computing the distortion. + */ + tb->reconstruct(ectx, ectx->img); + + + // measure rate +
View file
libde265-1.0.3.tar.gz/libde265/encoder/algo/tb-transform.h
Added
@@ -0,0 +1,86 @@ +/* + * H.265 video codec. + * Copyright (c) 2013-2014 struktur AG, Dirk Farin <farin@struktur.de> + * + * Authors: Dirk Farin <farin@struktur.de> + * + * This file is part of libde265. + * + * libde265 is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * libde265 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with libde265. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef TB_TRANSFORM_H +#define TB_TRANSFORM_H + +#include "libde265/nal-parser.h" +#include "libde265/decctx.h" +#include "libde265/encoder/encoder-types.h" +#include "libde265/encoder/algo/algo.h" +#include "libde265/slice.h" +#include "libde265/scan.h" +#include "libde265/intrapred.h" +#include "libde265/transform.h" +#include "libde265/fallback-dct.h" +#include "libde265/quality.h" +#include "libde265/fallback.h" +#include "libde265/configparam.h" + +#include "libde265/encoder/algo/tb-intrapredmode.h" +#include "libde265/encoder/algo/tb-rateestim.h" + + +void diff_blk(int16_t* out,int out_stride, + const uint8_t* a_ptr, int a_stride, + const uint8_t* b_ptr, int b_stride, + int blkSize); + + +// ========== TB split decision ========== + +class Algo_TB_Residual : public Algo +{ +public: + Algo_TB_Residual() { } + + virtual enc_tb* analyze(encoder_context*, + context_model_table&, + const de265_image* input, + enc_tb* tb, + int TrafoDepth, int MaxTrafoDepth, int IntraSplitFlag) = 0; + + const char* name() const { return "residual-unknown"; } +}; + + +class Algo_TB_Transform : public Algo_TB_Residual +{ +public: + Algo_TB_Transform() : mAlgo_TB_RateEstimation(NULL) { } + + virtual enc_tb* analyze(encoder_context*, + context_model_table&, + const de265_image* input, + enc_tb* parent, + int TrafoDepth, int MaxTrafoDepth, int IntraSplitFlag); + + void setAlgo_TB_RateEstimation(Algo_TB_RateEstimation* algo) { mAlgo_TB_RateEstimation=algo; } + + const char* name() const { return "residual-FDCT"; } + + protected: + Algo_TB_RateEstimation* mAlgo_TB_RateEstimation; +}; + + +#endif
View file
libde265-1.0.2.tar.gz/libde265/encoder/encoder-context.cc -> libde265-1.0.3.tar.gz/libde265/encoder/encoder-context.cc
Changed
@@ -21,7 +21,6 @@ */ #include "encoder/encoder-context.h" -#include "encoder/analyze.h" #include "libde265/util.h" #include <math.h> @@ -31,6 +30,10 @@ { encoder_started=false; + vps = std::make_shared<video_parameter_set>(); + sps = std::make_shared<seq_parameter_set>(); + pps = std::make_shared<pic_parameter_set>(); + //img_source = NULL; //reconstruction_sink = NULL; //packet_sink = NULL; @@ -126,33 +129,43 @@ // VPS - vps.set_defaults(Profile_Main, 6,2); + vps->set_defaults(Profile_Main, 6,2); // SPS - sps.set_defaults(); - sps.set_CB_log2size_range( Log2(params.min_cb_size), Log2(params.max_cb_size)); - sps.set_TB_log2size_range( Log2(params.min_tb_size), Log2(params.max_tb_size)); - sps.max_transform_hierarchy_depth_intra = params.max_transform_hierarchy_depth_intra; + sps->set_defaults(); + sps->set_CB_log2size_range( Log2(params.min_cb_size), Log2(params.max_cb_size)); + sps->set_TB_log2size_range( Log2(params.min_tb_size), Log2(params.max_tb_size)); + sps->max_transform_hierarchy_depth_intra = params.max_transform_hierarchy_depth_intra; + sps->max_transform_hierarchy_depth_inter = params.max_transform_hierarchy_depth_inter; + + if (imgdata->input->get_chroma_format() == de265_chroma_444) { + sps->chroma_format_idc = CHROMA_444; + } - sps.set_resolution(image_width, image_height); + sps->set_resolution(image_width, image_height); sop->set_SPS_header_values(); - sps.compute_derived_values(); + de265_error err = sps->compute_derived_values(true); + if (err != DE265_OK) { + fprintf(stderr,"invalid SPS parameters\n"); + exit(10); + } // PPS - pps.set_defaults(); - pps.pic_init_qp = algo.getPPS_QP(); + pps->set_defaults(); + pps->sps = sps.get(); + pps->pic_init_qp = algo.getPPS_QP(); // turn off deblocking filter - pps.deblocking_filter_control_present_flag = true; - pps.deblocking_filter_override_enabled_flag = false; - pps.pic_disable_deblocking_filter_flag = true; - pps.pps_loop_filter_across_slices_enabled_flag = false; + pps->deblocking_filter_control_present_flag = true; + pps->deblocking_filter_override_enabled_flag = false; + pps->pic_disable_deblocking_filter_flag = true; + pps->pps_loop_filter_across_slices_enabled_flag = false; - pps.set_derived_values(&sps); + pps->set_derived_values(sps.get()); @@ -162,7 +175,7 @@ nal.set(NAL_UNIT_VPS_NUT); nal.write(cabac_encoder); - vps.write(this, cabac_encoder); + vps->write(this, cabac_encoder); cabac_encoder.add_trailing_bits(); cabac_encoder.flush_VLC(); pck = create_packet(EN265_PACKET_VPS); @@ -171,7 +184,7 @@ nal.set(NAL_UNIT_SPS_NUT); nal.write(cabac_encoder); - sps.write(this, cabac_encoder); + sps->write(this, cabac_encoder); cabac_encoder.add_trailing_bits(); cabac_encoder.flush_VLC(); pck = create_packet(EN265_PACKET_SPS); @@ -180,7 +193,7 @@ nal.set(NAL_UNIT_PPS_NUT); nal.write(cabac_encoder); - pps.write(this, cabac_encoder, &sps); + pps->write(this, cabac_encoder, sps.get()); cabac_encoder.add_trailing_bits(); cabac_encoder.flush_VLC(); pck = create_packet(EN265_PACKET_PPS); @@ -207,6 +220,8 @@ image_width = id->input->get_width(); image_height = id->input->get_height(); image_spec_is_defined = true; + + ctbs.alloc(image_width, image_height, Log2(params.max_cb_size)); } @@ -224,11 +239,6 @@ } - if (!headers_have_been_sent) { - encode_headers(); - } - - @@ -242,18 +252,27 @@ loginfo(LogEncoder,"encoding frame %d\n",imgdata->frame_number); + // write headers if not written yet + + if (!headers_have_been_sent) { + encode_headers(); + } + + // write slice header // slice imgdata->shdr.slice_deblocking_filter_disabled_flag = true; imgdata->shdr.slice_loop_filter_across_slices_enabled_flag = false; - imgdata->shdr.compute_derived_values(&pps); + imgdata->shdr.compute_derived_values(pps.get()); + + imgdata->shdr.pps = &get_pps(); //shdr.slice_pic_order_cnt_lsb = poc & 0xFF; imgdata->nal.write(cabac_encoder); - imgdata->shdr.write(this, cabac_encoder, &sps, &pps, imgdata->nal.nal_unit_type); + imgdata->shdr.write(this, cabac_encoder, sps.get(), pps.get(), imgdata->nal.nal_unit_type); cabac_encoder.add_trailing_bits(); cabac_encoder.flush_VLC();
View file
libde265-1.0.2.tar.gz/libde265/encoder/encoder-context.h -> libde265-1.0.3.tar.gz/libde265/encoder/encoder-context.h
Changed
@@ -54,7 +54,7 @@ encoder_params params; config_parameters params_config; - EncodingAlgorithm_Custom algo; + EncoderCore_Custom algo; int image_width, image_height; bool image_spec_is_defined; // whether we know the input image size @@ -69,10 +69,12 @@ // quick links de265_image* img; // reconstruction - de265_image* prediction; + //de265_image* prediction; image_data* imgdata; // input image slice_segment_header* shdr; + CTBTreeMatrix ctbs; + // temporary memory for motion compensated pixels (when CB-algo passes this down to TB-algo) //uint8_t prediction[3][64*64]; // stride: 1<<(cb->log2Size) //int prediction_x0,prediction_y0; @@ -82,11 +84,23 @@ /*int target_qp;*/ /* QP we want to code at. (Not actually the real QP. Check image.get_QPY() for that.) */ - video_parameter_set vps; - seq_parameter_set sps; - pic_parameter_set pps; + const seq_parameter_set& get_sps() const { return *sps; } + const pic_parameter_set& get_pps() const { return *pps; } + + seq_parameter_set& get_sps() { return *sps; } + pic_parameter_set& get_pps() { return *pps; } + + std::shared_ptr<video_parameter_set>& get_shared_vps() { return vps; } + std::shared_ptr<seq_parameter_set>& get_shared_sps() { return sps; } + std::shared_ptr<pic_parameter_set>& get_shared_pps() { return pps; } + + private: + std::shared_ptr<video_parameter_set> vps; + std::shared_ptr<seq_parameter_set> sps; + std::shared_ptr<pic_parameter_set> pps; //slice_segment_header shdr; + public: bool parameters_have_been_set; bool headers_have_been_sent;
View file
libde265-1.0.3.tar.gz/libde265/encoder/encoder-core.cc
Added
@@ -0,0 +1,428 @@ +/* + * H.265 video codec. + * Copyright (c) 2013-2014 struktur AG, Dirk Farin <farin@struktur.de> + * + * Authors: struktur AG, Dirk Farin <farin@struktur.de> + * + * This file is part of libde265. + * + * libde265 is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * libde265 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with libde265. If not, see <http://www.gnu.org/licenses/>. + */ + + +#include "libde265/encoder/encoder-core.h" +#include "libde265/encoder/encoder-context.h" +#include "libde265/encoder/encoder-syntax.h" +#include <assert.h> +#include <limits> +#include <math.h> +#include <iostream> +#include <fstream> + + +#define ENCODER_DEVELOPMENT 0 +#define COMPARE_ESTIMATED_RATE_TO_REAL_RATE 0 + + +static int IntraPredModeCnt[7][35]; +static int MPM_used[7][35]; + +static int IntraPredModeCnt_total[35]; +static int MPM_used_total[35]; + +/* +void statistics_IntraPredMode(const encoder_context* ectx, int x,int y, const enc_cb* cb) +{ + if (cb->split_cu_flag) { + for (int i=0;i<4;i++) + if (cb->children[i]) { + statistics_IntraPredMode(ectx, childX(x,i,cb->log2Size), childY(y,i,cb->log2Size), cb->children[i]); + } + } + else { + int cnt; + int size = cb->log2Size; + + if (cb->PartMode == PART_NxN) { cnt=4; size--; } else cnt=1; + + for (int i=0;i<cnt;i++) { + IntraPredModeCnt[size][ cb->intra.pred_mode[i] ]++; + IntraPredModeCnt_total[ cb->intra.pred_mode[i] ]++; + + int xi = childX(x,i,cb->log2Size); + int yi = childY(y,i,cb->log2Size); + + enum IntraPredMode candModeList[3]; + fillIntraPredModeCandidates(candModeList,xi,yi, xi>0, yi>0, ectx->img); + + int predmode = cb->intra.pred_mode[i]; + if (candModeList[0]==predmode || + candModeList[1]==predmode || + candModeList[2]==predmode) { + MPM_used[size][predmode]++; + MPM_used_total[predmode]++; + } + } + } +} +*/ + +void statistics_print() +{ + for (int i=0;i<35;i++) { + printf("%d",i); + printf(" %d %d",IntraPredModeCnt_total[i], MPM_used_total[i]); + + for (int k=2;k<=6;k++) { + printf(" %d %d",IntraPredModeCnt[k][i], MPM_used[k][i]); + } + + printf("\n"); + } +} + + +void print_tb_tree_rates(const enc_tb* tb, int level) +{ + for (int i=0;i<level;i++) + std::cout << " "; + + std::cout << "TB rate=" << tb->rate << " (" << tb->rate_withoutCbfChroma << ")\n"; + if (tb->split_transform_flag) { + for (int i=0;i<4;i++) + print_tb_tree_rates(tb->children[i], level+1); + } +} + + +void print_cb_tree_rates(const enc_cb* cb, int level) +{ + for (int i=0;i<level;i++) + std::cout << " "; + + std::cout << "CB rate=" << cb->rate << "\n"; + if (cb->split_cu_flag) { + for (int i=0;i<4;i++) + print_cb_tree_rates(cb->children[i], level+1); + } + else { + print_tb_tree_rates(cb->transform_tree, level+1); + } +} + + +// /*LIBDE265_API*/ ImageSink_YUV reconstruction_sink; + +double encode_image(encoder_context* ectx, + const de265_image* input, + EncoderCore& algo) +{ + int stride=input->get_image_stride(0); + + int w = ectx->get_sps().pic_width_in_luma_samples; + int h = ectx->get_sps().pic_height_in_luma_samples; + + // --- create reconstruction image --- + ectx->img = new de265_image; + ectx->img->set_headers(ectx->get_shared_vps(), ectx->get_shared_sps(), ectx->get_shared_pps()); + ectx->img->PicOrderCntVal = input->PicOrderCntVal; + + ectx->img->alloc_image(w,h, input->get_chroma_format(), ectx->get_shared_sps(), true, + NULL /* no decctx */, ectx, 0,NULL,false); + //ectx->img->alloc_encoder_data(&ectx->sps); + ectx->img->clear_metadata(); + +#if 0 + if (1) { + ectx->prediction = new de265_image; + ectx->prediction->alloc_image(w,h, input->get_chroma_format(), &ectx->sps, false /* no metadata */, + NULL /* no decctx */, NULL /* no encctx */, 0,NULL,false); + ectx->prediction->vps = ectx->vps; + ectx->prediction->sps = ectx->sps; + ectx->prediction->pps = ectx->pps; + } +#endif + + ectx->active_qp = ectx->get_pps().pic_init_qp; // TODO take current qp from slice + + + ectx->cabac_ctx_models.init(ectx->shdr->initType, ectx->shdr->SliceQPY); + ectx->cabac_encoder.set_context_models(&ectx->cabac_ctx_models); + + + context_model_table modelEstim; + CABAC_encoder_estim cabacEstim; + + modelEstim.init(ectx->shdr->initType, ectx->shdr->SliceQPY); + cabacEstim.set_context_models(&modelEstim); + + + int Log2CtbSize = ectx->get_sps().Log2CtbSizeY; + + uint8_t* luma_plane = ectx->img->get_image_plane(0); + uint8_t* cb_plane = ectx->img->get_image_plane(1); + uint8_t* cr_plane = ectx->img->get_image_plane(2); + + double mse=0; + + + // encode CTB by CTB + + ectx->ctbs.clear(); + + for (int y=0;y<ectx->get_sps().PicHeightInCtbsY;y++) + for (int x=0;x<ectx->get_sps().PicWidthInCtbsY;x++) + { + ectx->img->set_SliceAddrRS(x, y, ectx->shdr->SliceAddrRS); + + int x0 = x<<Log2CtbSize; + int y0 = y<<Log2CtbSize; + + logtrace(LogSlice,"encode CTB at %d %d\n",x0,y0); + + // make a copy of the context model that we can modify for testing alternatives + + context_model_table ctxModel; + //copy_context_model_table(ctxModel, ectx->ctx_model_bitstream); + ctxModel = ectx->cabac_ctx_models.copy(); + ctxModel = modelEstim.copy(); // TODO TMP
View file
libde265-1.0.3.tar.gz/libde265/encoder/encoder-core.h
Added
@@ -0,0 +1,151 @@ +/* + * H.265 video codec. + * Copyright (c) 2013-2014 struktur AG, Dirk Farin <farin@struktur.de> + * + * Authors: Dirk Farin <farin@struktur.de> + * + * This file is part of libde265. + * + * libde265 is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * libde265 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with libde265. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef ANALYZE_H +#define ANALYZE_H + +#include "libde265/nal-parser.h" +#include "libde265/decctx.h" +#include "libde265/encoder/encoder-types.h" +#include "libde265/slice.h" +#include "libde265/scan.h" +#include "libde265/intrapred.h" +#include "libde265/transform.h" +#include "libde265/fallback-dct.h" +#include "libde265/quality.h" +#include "libde265/fallback.h" +#include "libde265/configparam.h" + +#include "libde265/encoder/algo/tb-intrapredmode.h" +#include "libde265/encoder/algo/tb-transform.h" +#include "libde265/encoder/algo/tb-split.h" +#include "libde265/encoder/algo/cb-intrapartmode.h" +#include "libde265/encoder/algo/cb-interpartmode.h" +#include "libde265/encoder/algo/cb-split.h" +#include "libde265/encoder/algo/ctb-qscale.h" +#include "libde265/encoder/algo/cb-mergeindex.h" +//#include "libde265/encoder/algo/cb-skip-or-inter.h" +#include "libde265/encoder/algo/pb-mv.h" +#include "libde265/encoder/algo/cb-skip.h" +#include "libde265/encoder/algo/cb-intra-inter.h" + + +/* Encoder search tree, bottom up: + + - Algo_TB_Split - whether TB is split or not + + - Algo_TB_IntraPredMode - choose the intra prediction mode (or NOP, if at the wrong tree level) + + - Algo_CB_IntraPartMode - choose between NxN and 2Nx2N intra parts + + - Algo_CB_PredMode - intra / inter + + - Algo_CB_Split - whether CB is split or not + + - Algo_CTB_QScale - select QScale on CTB granularity + */ + + +// ========== an encoding algorithm combines a set of algorithm modules ========== + +class EncoderCore +{ + public: + virtual ~EncoderCore() { } + + virtual Algo_CTB_QScale* getAlgoCTBQScale() = 0; + + virtual int getPPS_QP() const = 0; + virtual int getSlice_QPDelta() const { return 0; } +}; + + +class EncoderCore_Custom : public EncoderCore +{ + public: + + void setParams(struct encoder_params& params); + + void registerParams(config_parameters& config) { + mAlgo_CTB_QScale_Constant.registerParams(config); + mAlgo_CB_IntraPartMode_Fixed.registerParams(config); + mAlgo_CB_InterPartMode_Fixed.registerParams(config); + mAlgo_PB_MV_Test.registerParams(config); + mAlgo_PB_MV_Search.registerParams(config); + mAlgo_TB_IntraPredMode_FastBrute.registerParams(config); + mAlgo_TB_IntraPredMode_MinResidual.registerParams(config); + mAlgo_TB_Split_BruteForce.registerParams(config); + } + + virtual Algo_CTB_QScale* getAlgoCTBQScale() { return &mAlgo_CTB_QScale_Constant; } + + virtual int getPPS_QP() const { return mAlgo_CTB_QScale_Constant.getQP(); } + + private: + Algo_CTB_QScale_Constant mAlgo_CTB_QScale_Constant; + + Algo_CB_Split_BruteForce mAlgo_CB_Split_BruteForce; + Algo_CB_Skip_BruteForce mAlgo_CB_Skip_BruteForce; + Algo_CB_IntraInter_BruteForce mAlgo_CB_IntraInter_BruteForce; + + Algo_CB_IntraPartMode_BruteForce mAlgo_CB_IntraPartMode_BruteForce; + Algo_CB_IntraPartMode_Fixed mAlgo_CB_IntraPartMode_Fixed; + + Algo_CB_InterPartMode_Fixed mAlgo_CB_InterPartMode_Fixed; + Algo_CB_MergeIndex_Fixed mAlgo_CB_MergeIndex_Fixed; + + Algo_PB_MV_Test mAlgo_PB_MV_Test; + Algo_PB_MV_Search mAlgo_PB_MV_Search; + + Algo_TB_Split_BruteForce mAlgo_TB_Split_BruteForce; + + Algo_TB_IntraPredMode_BruteForce mAlgo_TB_IntraPredMode_BruteForce; + Algo_TB_IntraPredMode_FastBrute mAlgo_TB_IntraPredMode_FastBrute; + Algo_TB_IntraPredMode_MinResidual mAlgo_TB_IntraPredMode_MinResidual; + + Algo_TB_Transform mAlgo_TB_Transform; + Algo_TB_RateEstimation_None mAlgo_TB_RateEstimation_None; + Algo_TB_RateEstimation_Exact mAlgo_TB_RateEstimation_Exact; +}; + + + +double encode_image(encoder_context*, const de265_image* input, EncoderCore&); + +void encode_sequence(encoder_context*); + + +class Logging +{ +public: + virtual ~Logging() { } + + static void print_logging(const encoder_context* ectx, const char* id, const char* filename); + + virtual const char* name() const = 0; + virtual void print(const encoder_context* ectx, const char* filename) = 0; +}; + + +LIBDE265_API void en265_print_logging(const encoder_context* ectx, const char* id, const char* filename); + +#endif
View file
libde265-1.0.2.tar.gz/libde265/encoder/encoder-params.cc -> libde265-1.0.3.tar.gz/libde265/encoder/encoder-params.cc
Changed
@@ -45,12 +45,18 @@ max_transform_hierarchy_depth_intra.set_range(0,4); max_transform_hierarchy_depth_intra.set_default(3); + max_transform_hierarchy_depth_inter.set_ID("max-transform-hierarchy-depth-inter"); + max_transform_hierarchy_depth_inter.set_range(0,4); + max_transform_hierarchy_depth_inter.set_default(3); + sop_structure.set_ID("sop-structure"); mAlgo_TB_IntraPredMode.set_ID("TB-IntraPredMode"); mAlgo_TB_IntraPredMode_Subset.set_ID("TB-IntraPredMode-subset"); mAlgo_CB_IntraPartMode.set_ID("CB-IntraPartMode"); + mAlgo_TB_RateEstimation.set_ID("TB-RateEstimation"); + mAlgo_MEMode.set_ID("MEMode"); } @@ -62,6 +68,7 @@ config.add_option(&min_tb_size); config.add_option(&max_tb_size); config.add_option(&max_transform_hierarchy_depth_intra); + config.add_option(&max_transform_hierarchy_depth_inter); config.add_option(&sop_structure); @@ -70,6 +77,7 @@ config.add_option(&mAlgo_CB_IntraPartMode); config.add_option(&mAlgo_MEMode); + config.add_option(&mAlgo_TB_RateEstimation); mSOP_LowDelay.registerParams(config); }
View file
libde265-1.0.2.tar.gz/libde265/encoder/encoder-params.h -> libde265-1.0.3.tar.gz/libde265/encoder/encoder-params.h
Changed
@@ -23,8 +23,8 @@ #ifndef ENCODER_PARAMS_H #define ENCODER_PARAMS_H -#include "libde265/encoder/encode.h" -#include "libde265/encoder/analyze.h" +#include "libde265/encoder/encoder-types.h" +#include "libde265/encoder/encoder-core.h" #include "libde265/encoder/sop.h" @@ -88,6 +88,7 @@ option_int max_tb_size; option_int max_transform_hierarchy_depth_intra; + option_int max_transform_hierarchy_depth_inter; option_SOP_Structure sop_structure; @@ -132,6 +133,7 @@ // rate-control enum RateControlMethod rateControlMethod; + option_ALGO_TB_RateEstimation mAlgo_TB_RateEstimation; //int constant_QP; //int lambda;
View file
libde265-1.0.3.tar.gz/libde265/encoder/encoder-syntax.cc
Added
@@ -0,0 +1,1729 @@ +/* + * H.265 video codec. + * Copyright (c) 2013-2014 struktur AG, Dirk Farin <farin@struktur.de> + * + * Authors: struktur AG, Dirk Farin <farin@struktur.de> + * + * This file is part of libde265. + * + * libde265 is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * libde265 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with libde265. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "encoder-syntax.h" +#include "encoder-context.h" +#include "slice.h" +#include "scan.h" +#include "intrapred.h" +#include "libde265/transform.h" +#include "libde265/fallback-dct.h" +#include <iostream> + + +#ifdef DE265_LOG_DEBUG +#define ESTIM_BITS_BEGIN \ + CABAC_encoder_estim* log_estim; \ + float log_bits_pre = 0; \ + if (logdebug_enabled(LogEncoder)) { \ + log_estim = dynamic_cast<CABAC_encoder_estim*>(cabac); \ + if (log_estim) { \ + log_bits_pre = log_estim->getRDBits(); \ + } \ + } + +#define ESTIM_BITS_END(name) \ + if (logdebug_enabled(LogEncoder)) { \ + if (log_estim) { \ + float bits_post = log_estim->getRDBits(); \ + printf("%s=%f\n",name,bits_post - log_bits_pre); \ + } \ + } +#else +#define ESTIM_BITS_BEGIN +#define ESTIM_BITS_END(name) +#endif + + + +static void internal_recursive_cbfChroma_rate(CABAC_encoder_estim* cabac, + enc_tb* tb, int log2TrafoSize, int trafoDepth) +{ + // --- CBF CB/CR --- + + // For 4x4 luma, there is no signaling of chroma CBF, because only the + // chroma CBF for 8x8 is relevant. + if (log2TrafoSize>2) { + if (trafoDepth==0 || tb->parent->cbf[1]) { + encode_cbf_chroma(cabac, trafoDepth, tb->cbf[1]); + } + if (trafoDepth==0 || tb->parent->cbf[2]) { + encode_cbf_chroma(cabac, trafoDepth, tb->cbf[2]); + } + } + + if (tb->split_transform_flag) { + for (int i=0;i<4;i++) { + internal_recursive_cbfChroma_rate(cabac, tb->children[i], log2TrafoSize-1, trafoDepth+1); + } + } +} + + +float recursive_cbfChroma_rate(CABAC_encoder_estim* cabac, + enc_tb* tb, int log2TrafoSize, int trafoDepth) +{ + float bits_pre = cabac->getRDBits(); + + internal_recursive_cbfChroma_rate(cabac, tb, log2TrafoSize, trafoDepth); + + float bits_post = cabac->getRDBits(); + + return bits_post - bits_pre; +} + + + +void encode_split_cu_flag(encoder_context* ectx, + CABAC_encoder* cabac, + int x0, int y0, int ctDepth, int split_flag) +{ + logtrace(LogSymbols,"$1 split_cu_flag=%d\n",split_flag); + + // check if neighbors are available + + int availableL = check_CTB_available(ectx->img, x0,y0, x0-1,y0); + int availableA = check_CTB_available(ectx->img, x0,y0, x0,y0-1); + + int condL = 0; + int condA = 0; + + if (availableL && ectx->ctbs.getCB(x0-1,y0)->ctDepth > ctDepth) condL=1; + if (availableA && ectx->ctbs.getCB(x0,y0-1)->ctDepth > ctDepth) condA=1; + + int contextOffset = condL + condA; + int context = contextOffset; + + // decode bit + + logtrace(LogSlice,"> split_cu_flag = %d (context=%d)\n",split_flag,context); + + cabac->write_CABAC_bit(CONTEXT_MODEL_SPLIT_CU_FLAG + context, split_flag); +} + + +void encode_part_mode(encoder_context* ectx, + CABAC_encoder* cabac, + enum PredMode PredMode, enum PartMode PartMode, int cLog2CbSize) +{ + logtrace(LogSymbols,"$1 part_mode=%d\n",PartMode); + logtrace(LogSlice,"> part_mode = %d\n",PartMode); + + if (PredMode == MODE_INTRA) { + int bin = (PartMode==PART_2Nx2N); + cabac->write_CABAC_bit(CONTEXT_MODEL_PART_MODE+0, bin); + } + else { + if (PartMode==PART_2Nx2N) { + cabac->write_CABAC_bit(CONTEXT_MODEL_PART_MODE+0, 1); + return; + } + else { + cabac->write_CABAC_bit(CONTEXT_MODEL_PART_MODE+0, 0); + } + + if (cLog2CbSize > ectx->get_sps().Log2MinCbSizeY) { + if (ectx->get_sps().amp_enabled_flag) { + switch (PartMode) { + case PART_2NxN: + cabac->write_CABAC_bit(CONTEXT_MODEL_PART_MODE+1, 1); + cabac->write_CABAC_bit(CONTEXT_MODEL_PART_MODE+3, 1); + break; + case PART_Nx2N: + cabac->write_CABAC_bit(CONTEXT_MODEL_PART_MODE+1, 0); + cabac->write_CABAC_bit(CONTEXT_MODEL_PART_MODE+3, 1); + break; + case PART_2NxnU: + cabac->write_CABAC_bit(CONTEXT_MODEL_PART_MODE+1, 1); + cabac->write_CABAC_bit(CONTEXT_MODEL_PART_MODE+3, 0); + cabac->write_CABAC_bypass(0); + break; + case PART_2NxnD: + cabac->write_CABAC_bit(CONTEXT_MODEL_PART_MODE+1, 1); + cabac->write_CABAC_bit(CONTEXT_MODEL_PART_MODE+3, 0); + cabac->write_CABAC_bypass(1); + break; + case PART_nLx2N: + cabac->write_CABAC_bit(CONTEXT_MODEL_PART_MODE+1, 0); + cabac->write_CABAC_bit(CONTEXT_MODEL_PART_MODE+3, 0); + cabac->write_CABAC_bypass(0); + break; + case PART_nRx2N: + cabac->write_CABAC_bit(CONTEXT_MODEL_PART_MODE+1, 0); + cabac->write_CABAC_bit(CONTEXT_MODEL_PART_MODE+3, 0); + cabac->write_CABAC_bypass(1); + break; + case PART_NxN: + case PART_2Nx2N: + assert(false); + break; + } + } + else { + if (PartMode==PART_2NxN) { + cabac->write_CABAC_bit(CONTEXT_MODEL_PART_MODE+1, 1); + } + else { + assert(PartMode==PART_Nx2N); + cabac->write_CABAC_bit(CONTEXT_MODEL_PART_MODE+1, 0); + } + } + } + else { + if (PartMode==PART_2NxN) { + cabac->write_CABAC_bit(CONTEXT_MODEL_PART_MODE+1, 1); + } + else { + cabac->write_CABAC_bit(CONTEXT_MODEL_PART_MODE+1, 0); + + if (cLog2CbSize==3) { + assert(PartMode==PART_Nx2N);
View file
libde265-1.0.3.tar.gz/libde265/encoder/encoder-syntax.h
Added
@@ -0,0 +1,102 @@ +/* + * H.265 video codec. + * Copyright (c) 2013-2014 struktur AG, Dirk Farin <farin@struktur.de> + * + * Authors: Dirk Farin <farin@struktur.de> + * + * This file is part of libde265. + * + * libde265 is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * libde265 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with libde265. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef ENCODER_SYNTAX_H +#define ENCODER_SYNTAX_H + +#include "libde265/image.h" +#include "libde265/encoder/encoder-types.h" + + +void encode_split_cu_flag(encoder_context* ectx, + CABAC_encoder* cabac, + int x0, int y0, int ctDepth, int split_flag); + +void encode_transform_tree(encoder_context* ectx, + CABAC_encoder* cabac, + const enc_tb* tb, const enc_cb* cb, + int x0,int y0, int xBase,int yBase, + int log2TrafoSize, int trafoDepth, int blkIdx, + int MaxTrafoDepth, int IntraSplitFlag, bool recurse); + +void encode_coding_unit(encoder_context* ectx, + CABAC_encoder* cabac, + const enc_cb* cb, int x0,int y0, int log2CbSize, bool recurse); + +/* returns + 1 - forced split + 0 - forced non-split + -1 - optional split +*/ +enum SplitType { + ForcedNonSplit = 0, + ForcedSplit = 1, + OptionalSplit = 2 +}; + +SplitType get_split_type(const seq_parameter_set* sps, + int x0,int y0, int log2CbSize); + + +/* Compute how much rate is required for sending the chroma CBF flags + in the whole TB tree. + */ +float recursive_cbfChroma_rate(CABAC_encoder_estim* cabac, + enc_tb* tb, int log2TrafoSize, int trafoDepth); + + +void encode_split_transform_flag(encoder_context* ectx, + CABAC_encoder* cabac, + int log2TrafoSize, int split_flag); + +void encode_merge_idx(encoder_context* ectx, + CABAC_encoder* cabac, + int mergeIdx); + +void encode_cu_skip_flag(encoder_context* ectx, + CABAC_encoder* cabac, + const enc_cb* cb, + bool skip); + +void encode_cbf_luma(CABAC_encoder* cabac, + bool zeroTrafoDepth, int cbf_luma); + +void encode_cbf_chroma(CABAC_encoder* cabac, + int trafoDepth, int cbf_chroma); + +void encode_transform_unit(encoder_context* ectx, + CABAC_encoder* cabac, + const enc_tb* tb, const enc_cb* cb, + int x0,int y0, int xBase,int yBase, + int log2TrafoSize, int trafoDepth, int blkIdx); + + +void encode_quadtree(encoder_context* ectx, + CABAC_encoder* cabac, + const enc_cb* cb, int x0,int y0, int log2CbSize, int ctDepth, + bool recurse); + +void encode_ctb(encoder_context* ectx, + CABAC_encoder* cabac, + enc_cb* cb, int ctbX,int ctbY); + +#endif
View file
libde265-1.0.3.tar.gz/libde265/encoder/encoder-types.cc
Added
@@ -0,0 +1,766 @@ +/* + * H.265 video codec. + * Copyright (c) 2013-2014 struktur AG, Dirk Farin <farin@struktur.de> + * + * Authors: struktur AG, Dirk Farin <farin@struktur.de> + * + * This file is part of libde265. + * + * libde265 is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * libde265 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with libde265. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "encoder-types.h" +#include "encoder-context.h" +#include "slice.h" +#include "scan.h" +#include "intrapred.h" +#include "libde265/transform.h" +#include "libde265/fallback-dct.h" +#include <iostream> + + +int allocTB = 0; +int allocCB = 0; + +#define DEBUG_ALLOCS 0 + + +small_image_buffer::small_image_buffer(int log2Size,int bytes_per_pixel) +{ + mWidth = 1<<log2Size; + mHeight = 1<<log2Size; + mStride = 1<<log2Size; + mBytesPerRow = bytes_per_pixel * (1<<log2Size); + + int nBytes = mWidth*mHeight*bytes_per_pixel; + mBuf = new uint8_t[nBytes]; +} + + +small_image_buffer::~small_image_buffer() +{ + delete[] mBuf; +} + + +void enc_cb::set_rqt_root_bf_from_children_cbf() +{ + assert(transform_tree); + inter.rqt_root_cbf = (transform_tree->cbf[0] | + transform_tree->cbf[1] | + transform_tree->cbf[2]); +} + + + + +alloc_pool enc_tb::mMemPool(sizeof(enc_tb)); + +enc_tb::enc_tb(int x,int y,int log2TbSize, enc_cb* _cb) + : enc_node(x,y,log2TbSize) +{ + parent = NULL; + cb = _cb; + downPtr = NULL; + blkIdx = 0; + + split_transform_flag = false; + coeff[0]=coeff[1]=coeff[2]=NULL; + + TrafoDepth = 0; + cbf[0] = cbf[1] = cbf[2] = 0; + + distortion = 0; + rate = 0; + rate_withoutCbfChroma = 0; + + intra_mode = INTRA_PLANAR; + intra_mode_chroma = INTRA_PLANAR; + + if (DEBUG_ALLOCS) { allocTB++; printf("TB : %d\n",allocTB); } +} + + +enc_tb::~enc_tb() +{ + if (split_transform_flag) { + for (int i=0;i<4;i++) { + delete children[i]; + } + } + else { + for (int i=0;i<3;i++) { + delete[] coeff[i]; + } + } + + if (DEBUG_ALLOCS) { allocTB--; printf("TB ~: %d\n",allocTB); } +} + + +void enc_tb::alloc_coeff_memory(int cIdx, int tbSize) +{ + assert(coeff[cIdx]==NULL); + coeff[cIdx] = new int16_t[tbSize*tbSize]; +} + + +void enc_tb::reconstruct_tb(encoder_context* ectx, + de265_image* img, + int x0,int y0, // luma + int log2TbSize, // chroma adapted + int cIdx) const +{ + // chroma adapted position + int xC=x0; + int yC=y0; + + if (cIdx>0 && ectx->get_sps().chroma_format_idc == CHROMA_420) { + xC>>=1; + yC>>=1; + } + + + if (!reconstruction[cIdx]) { + + reconstruction[cIdx] = std::make_shared<small_image_buffer>(log2TbSize, sizeof(uint8_t)); + + if (cb->PredMode == MODE_SKIP) { + PixelAccessor dstPixels(*reconstruction[cIdx], xC,yC); + dstPixels.copyFromImage(img, cIdx); + } + else { // not SKIP mode + if (cb->PredMode == MODE_INTRA) { + + //enum IntraPredMode intraPredMode = img->get_IntraPredMode(x0,y0); + enum IntraPredMode intraPredMode = intra_mode; + + if (cIdx>0) { + intraPredMode = intra_mode_chroma; + } + + //printf("reconstruct TB (%d;%d): intra mode (cIdx=%d) = %d\n",xC,yC,cIdx,intraPredMode); + + //decode_intra_prediction(img, xC,yC, intraPredMode, 1<< log2TbSize , cIdx); + + //printf("access intra-prediction of TB %p\n",this); + + intra_prediction[cIdx]->copy_to(*reconstruction[cIdx]); + /* + copy_subimage(img->get_image_plane_at_pos(cIdx,xC,yC), + img->get_image_stride(cIdx), + intra_prediction[cIdx]->get_buffer<uint8_t>(), 1<<log2TbSize, + 1<<log2TbSize, 1<<log2TbSize); + */ + } + else { + assert(0); // -> TODO: now only store in tb_enc + + int size = 1<<log2TbSize; + + uint8_t* dst_ptr = img->get_image_plane_at_pos(cIdx, xC, yC ); + int dst_stride = img->get_image_stride(cIdx); + + /* TODO TMP HACK: prediction does not exist anymore + uint8_t* src_ptr = ectx->prediction->get_image_plane_at_pos(cIdx, xC, yC ); + int src_stride = ectx->prediction->get_image_stride(cIdx); + + for (int y=0;y<size;y++) { + for (int x=0;x<size;x++) { + dst_ptr[y*dst_stride+x] = src_ptr[y*src_stride+x]; + } + } + */ + } + + ALIGNED_16(int16_t) dequant_coeff[32*32]; + + if (cbf[cIdx]) dequant_coefficients(dequant_coeff, coeff[cIdx], log2TbSize, cb->qp); + + if (0 && cbf[cIdx]) { + printf("--- quantized coeffs ---\n"); + printBlk("qcoeffs",coeff[0],1<<log2TbSize,1<<log2TbSize); + + printf("--- dequantized coeffs ---\n"); + printBlk("dequant",dequant_coeff,1<<log2TbSize,1<<log2TbSize); + } + +#if 0
View file
libde265-1.0.3.tar.gz/libde265/encoder/encoder-types.h
Added
@@ -0,0 +1,409 @@ +/* + * H.265 video codec. + * Copyright (c) 2013-2014 struktur AG, Dirk Farin <farin@struktur.de> + * + * Authors: Dirk Farin <farin@struktur.de> + * + * This file is part of libde265. + * + * libde265 is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * libde265 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with libde265. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef ENCODE_H +#define ENCODE_H + +#include "libde265/image.h" +#include "libde265/decctx.h" +#include "libde265/image-io.h" +#include "libde265/alloc_pool.h" + +#include <memory> + +class encoder_context; +class enc_cb; + + +class small_image_buffer +{ + public: + explicit small_image_buffer(int log2Size,int bytes_per_pixel=1); + ~small_image_buffer(); + + uint8_t* get_buffer_u8() const { return mBuf; } + int16_t* get_buffer_s16() const { return (int16_t*)mBuf; } + uint16_t* get_buffer_u16() const { return (uint16_t*)mBuf; } + template <class pixel_t> pixel_t* get_buffer() const { return (pixel_t*)mBuf; } + + void copy_to(small_image_buffer& b) const { + assert(b.mHeight==mHeight); + assert(b.mBytesPerRow==mBytesPerRow); + memcpy(b.mBuf, mBuf, mBytesPerRow*mHeight); + } + + int getWidth() const { return mWidth; } + int getHeight() const { return mHeight; } + + int getStride() const { return mStride; } // pixels per row + + private: + uint8_t* mBuf; + uint16_t mStride; + uint16_t mBytesPerRow; + + uint8_t mWidth, mHeight; + + // small_image_buffer cannot be copied + + small_image_buffer(const small_image_buffer&) { assert(false); } // = delete; + small_image_buffer& operator=(const small_image_buffer&) { assert(false); return *this; } // = delete; +}; + + +class enc_node +{ +public: + enc_node() { } + enc_node(int _x,int _y, int _log2Size) : x(_x), y(_y), log2Size(_log2Size) { } + virtual ~enc_node() { } + + uint16_t x,y; + uint8_t log2Size : 3; + + + static const int DUMPTREE_INTRA_PREDICTION = (1<<0); + static const int DUMPTREE_RESIDUAL = (1<<1); + static const int DUMPTREE_RECONSTRUCTION = (1<<2); + static const int DUMPTREE_ALL = 0xFFFF; + + virtual void debug_dumpTree(int flags, int indent=0) const = 0; +}; + + +class PixelAccessor +{ + public: + PixelAccessor(small_image_buffer& buf, int x0,int y0) { + mBase = buf.get_buffer_u8(); + mStride = buf.getStride(); + mXMin = x0; + mYMin = y0; + mWidth = buf.getWidth(); + mHeight= buf.getHeight(); + + mBase -= x0 + y0*mStride; + } + + const uint8_t* operator[](int y) const { return mBase+y*mStride; } + + int getLeft() const { return mXMin; } + int getWidth() const { return mWidth; } + int getTop() const { return mYMin; } + int getHeight() const { return mHeight; } + + void copyToImage(de265_image* img, int cIdx) const; + void copyFromImage(const de265_image* img, int cIdx); + + static PixelAccessor invalid() { + return PixelAccessor(); + } + + private: + uint8_t* mBase; + short mStride; + short mXMin, mYMin; + uint8_t mWidth, mHeight; + + PixelAccessor() { + mBase = NULL; + mStride = mXMin = mYMin = mWidth = mHeight = 0; + } +}; + + +class enc_tb : public enc_node +{ + public: + enc_tb(int x,int y,int log2TbSize, enc_cb* _cb); + ~enc_tb(); + + enc_tb* parent; + enc_cb* cb; + enc_tb** downPtr; + + uint8_t split_transform_flag : 1; + uint8_t TrafoDepth : 2; // 2 bits enough ? (TODO) + uint8_t blkIdx : 2; + + enum IntraPredMode intra_mode; + + // Note: in NxN partition mode, the chroma mode is always derived from + // the top-left child's intra mode (for chroma 4:2:0). + enum IntraPredMode intra_mode_chroma; + + uint8_t cbf[3]; + + + /* intra_prediction and residual is filled in tb-split, because this is where we decide + on the final block-size the TB is coded with. + */ + //mutable uint8_t debug_intra_border[2*64+1]; + std::shared_ptr<small_image_buffer> intra_prediction[3]; + std::shared_ptr<small_image_buffer> residual[3]; + + /* Reconstruction is computed on-demand in writeMetadata(). + */ + mutable std::shared_ptr<small_image_buffer> reconstruction[3]; + + union { + // split + struct { + enc_tb* children[4]; + }; + + // leaf node + struct { + int16_t* coeff[3]; + + bool skip_transform[3][2]; + uint8_t explicit_rdpcm[3][2]; + }; + }; + + float distortion; // total distortion for this level of the TB tree (including all children) + float rate; // total rate for coding this TB level and all children + float rate_withoutCbfChroma; + + void set_cbf_flags_from_children(); + + void reconstruct(encoder_context* ectx, de265_image* img) const; + void debug_writeBlack(encoder_context* ectx, de265_image* img) const; + + bool isZeroBlock() const { return cbf[0]==false && cbf[1]==false && cbf[2]==false; } + + void alloc_coeff_memory(int cIdx, int tbSize); + + const enc_tb* getTB(int x,int y) const; + + PixelAccessor getPixels(int x,int y, int cIdx, const seq_parameter_set& sps); +
View file
libde265-1.0.2.tar.gz/libde265/encoder/sop.cc -> libde265-1.0.3.tar.gz/libde265/encoder/sop.cc
Changed
@@ -29,7 +29,7 @@ void sop_creator_intra_only::set_SPS_header_values() { - mEncCtx->sps.log2_max_pic_order_cnt_lsb = get_num_poc_lsb_bits(); + mEncCtx->get_sps().log2_max_pic_order_cnt_lsb = get_num_poc_lsb_bits(); } @@ -70,8 +70,8 @@ rps.NumNegativePics = 1; rps.NumPositivePics = 0; rps.compute_derived_values(); - mEncCtx->sps.ref_pic_sets.push_back(rps); - mEncCtx->sps.log2_max_pic_order_cnt_lsb = get_num_poc_lsb_bits(); + mEncCtx->get_sps().ref_pic_sets.push_back(rps); + mEncCtx->get_sps().log2_max_pic_order_cnt_lsb = get_num_poc_lsb_bits(); }
View file
libde265-1.0.2.tar.gz/libde265/fallback-dct.cc -> libde265-1.0.3.tar.gz/libde265/fallback-dct.cc
Changed
@@ -22,7 +22,7 @@ #if defined(_MSC_VER) || defined(__MINGW32__) # include <malloc.h> -#else +#elif defined(HAVE_ALLOCA_H) # include <alloca.h> #endif @@ -959,8 +959,6 @@ sum += mat_dct[fact*i][j] * input[c+j*stride]; } - //assert((sum+rnd1)>>shift1 <= 32767); - //assert((sum+rnd1)>>shift1 >= -32768); g[c+i*nT] = (sum+rnd1)>>shift1; // clipping to -32768;32767 unnecessary } }
View file
libde265-1.0.2.tar.gz/libde265/fallback-motion.cc -> libde265-1.0.3.tar.gz/libde265/fallback-motion.cc
Changed
@@ -23,7 +23,7 @@ #if defined(_MSC_VER) || defined(__MINGW32__) # include <malloc.h> -#else +#elif defined(HAVE_ALLOCA_H) # include <alloca.h> #endif
View file
libde265-1.0.2.tar.gz/libde265/image-io.cc -> libde265-1.0.3.tar.gz/libde265/image-io.cc
Changed
@@ -24,6 +24,18 @@ #include <assert.h> + +ImageSource::ImageSource() +{ +} + + +ImageSource_YUV::ImageSource_YUV() + : mFH(NULL) +{ +} + + ImageSource_YUV::~ImageSource_YUV() { if (mFH) { @@ -165,6 +177,12 @@ +PacketSink_File::PacketSink_File() + : mFH(NULL) +{ +} + + LIBDE265_API PacketSink_File::~PacketSink_File() { if (mFH) {
View file
libde265-1.0.2.tar.gz/libde265/image-io.h -> libde265-1.0.3.tar.gz/libde265/image-io.h
Changed
@@ -30,7 +30,7 @@ class ImageSource { public: - LIBDE265_API ImageSource() { } + LIBDE265_API ImageSource(); virtual LIBDE265_API ~ImageSource() { } //enum ImageStatus { Available, Waiting, EndOfVideo }; @@ -48,7 +48,7 @@ class ImageSource_YUV : public ImageSource { public: - LIBDE265_API ImageSource_YUV() : mFH(NULL) { } + LIBDE265_API ImageSource_YUV(); virtual LIBDE265_API ~ImageSource_YUV(); bool LIBDE265_API set_input_file(const char* filename, int w,int h); @@ -71,7 +71,6 @@ - class ImageSink { public: @@ -108,7 +107,7 @@ class PacketSink_File : public PacketSink { public: - LIBDE265_API PacketSink_File() : mFH(NULL) { } + LIBDE265_API PacketSink_File(); virtual LIBDE265_API ~PacketSink_File(); LIBDE265_API void set_filename(const char* filename);
View file
libde265-1.0.2.tar.gz/libde265/image.cc -> libde265-1.0.3.tar.gz/libde265/image.cc
Changed
@@ -47,7 +47,7 @@ #elif _WIN32 #define ALLOC_ALIGNED(alignment, size) _aligned_malloc((size), (alignment)) #define FREE_ALIGNED(mem) _aligned_free((mem)) -#elif __APPLE__ +#elif defined(HAVE_POSIX_MEMALIGN) static inline void *ALLOC_ALIGNED(size_t alignment, size_t size) { void *mem = NULL; if (posix_memalign(&mem, alignment, size) != 0) { @@ -106,17 +106,17 @@ static int de265_image_get_buffer(de265_decoder_context* ctx, de265_image_spec* spec, de265_image* img, void* userdata) { - const int rawChromaWidth = spec->width / img->sps.SubWidthC; - const int rawChromaHeight = spec->height / img->sps.SubHeightC; + const int rawChromaWidth = spec->width / img->SubWidthC; + const int rawChromaHeight = spec->height / img->SubHeightC; int luma_stride = (spec->width + spec->alignment-1) / spec->alignment * spec->alignment; int chroma_stride = (rawChromaWidth + spec->alignment-1) / spec->alignment * spec->alignment; - assert(img->sps.BitDepth_Y >= 8 && img->sps.BitDepth_Y <= 16); - assert(img->sps.BitDepth_C >= 8 && img->sps.BitDepth_C <= 16); + assert(img->BitDepth_Y >= 8 && img->BitDepth_Y <= 16); + assert(img->BitDepth_C >= 8 && img->BitDepth_C <= 16); - int luma_bpl = luma_stride * ((img->sps.BitDepth_Y+7)/8); - int chroma_bpl = chroma_stride * ((img->sps.BitDepth_C+7)/8); + int luma_bpl = luma_stride * ((img->BitDepth_Y+7)/8); + int chroma_bpl = chroma_stride * ((img->BitDepth_C+7)/8); int luma_height = spec->height; int chroma_height = rawChromaHeight; @@ -230,16 +230,16 @@ de265_error de265_image::alloc_image(int w,int h, enum de265_chroma c, - const seq_parameter_set* sps, bool allocMetadata, + std::shared_ptr<const seq_parameter_set> sps, bool allocMetadata, decoder_context* dctx, encoder_context* ectx, de265_PTS pts, void* user_data, bool useCustomAllocFunc) { //if (allocMetadata) { assert(sps); } - assert(sps); + if (allocMetadata) { assert(sps); } - this->sps = *sps; + if (sps) { this->sps = sps; } release(); /* TODO: review code for efficient allocation when arrays are already allocated to the requested size. Without the release, the old image-data @@ -281,21 +281,29 @@ spec.format = de265_image_format_YUV420P8; chroma_width = (chroma_width +1)/2; chroma_height = (chroma_height+1)/2; + SubWidthC = 2; + SubHeightC = 2; break; case de265_chroma_422: spec.format = de265_image_format_YUV422P8; chroma_width = (chroma_width+1)/2; + SubWidthC = 2; + SubHeightC = 1; break; case de265_chroma_444: spec.format = de265_image_format_YUV444P8; + SubWidthC = 1; + SubHeightC = 1; break; case de265_chroma_mono: spec.format = de265_image_format_mono8; chroma_width = 0; chroma_height= 0; + SubWidthC = 1; + SubHeightC = 1; break; default: @@ -303,6 +311,11 @@ break; } + if (sps) { + assert(sps->SubWidthC == SubWidthC); + assert(sps->SubHeightC == SubHeightC); + } + spec.width = w; spec.height = h; spec.alignment = STANDARD_ALIGNMENT; @@ -329,8 +342,11 @@ spec.visible_height= height_confwin; - bpp_shift[0] = (sps->BitDepth_Y > 8) ? 1 : 0; - bpp_shift[1] = (sps->BitDepth_C > 8) ? 1 : 0; + BitDepth_Y = (sps==NULL) ? 8 : sps->BitDepth_Y; + BitDepth_C = (sps==NULL) ? 8 : sps->BitDepth_C; + + bpp_shift[0] = (BitDepth_Y <= 8) ? 0 : 1; + bpp_shift[1] = (BitDepth_C <= 8) ? 0 : 1; bpp_shift[2] = bpp_shift[1]; @@ -515,7 +531,7 @@ Another option would be to safe the copied data not in an de265_image at all. */ - de265_error err = alloc_image(src->width, src->height, src->chroma_format, &src->sps, false, + de265_error err = alloc_image(src->width, src->height, src->chroma_format, src->sps, false, src->decctx, src->encctx, src->pts, src->user_data, false); if (err != DE265_OK) { return err; @@ -535,8 +551,8 @@ assert(first % 2 == 0); assert(end % 2 == 0); - int luma_bpp = (sps.BitDepth_Y+7)/8; - int chroma_bpp = (sps.BitDepth_C+7)/8; + int luma_bpp = (sps->BitDepth_Y+7)/8; + int chroma_bpp = (sps->BitDepth_C+7)/8; if (src->stride == stride) { memcpy(pixels[0] + first*stride * luma_bpp, @@ -551,8 +567,8 @@ } } - int first_chroma = first / src->sps.SubHeightC; - int end_chroma = end / src->sps.SubHeightC; + int first_chroma = first / src->SubHeightC; + int end_chroma = end / src->SubHeightC; if (src->chroma_format != de265_chroma_mono) { if (src->chroma_stride == chroma_stride) { @@ -650,7 +666,7 @@ void de265_image::wait_for_progress(thread_task* task, int ctbx,int ctby, int progress) { - const int ctbW = sps.PicWidthInCtbsY; + const int ctbW = sps->PicWidthInCtbsY; wait_for_progress(task, ctbx + ctbW*ctby, progress); } @@ -712,7 +728,7 @@ } -void de265_image::set_mv_info(int x,int y, int nPbW,int nPbH, const MotionVectorSpec& mv) +void de265_image::set_mv_info(int x,int y, int nPbW,int nPbH, const PBMotion& mv) { int log2PuSize = 2; @@ -726,7 +742,7 @@ for (int pby=0;pby<hPu;pby++) for (int pbx=0;pbx<wPu;pbx++) { - pb_info[ xPu+pbx + (yPu+pby)*stride ].mv = mv; + pb_info[ xPu+pbx + (yPu+pby)*stride ] = mv; } } @@ -734,28 +750,28 @@ bool de265_image::available_zscan(int xCurr,int yCurr, int xN,int yN) const { if (xN<0 || yN<0) return false; - if (xN>=sps.pic_width_in_luma_samples || - yN>=sps.pic_height_in_luma_samples) return false; + if (xN>=sps->pic_width_in_luma_samples || + yN>=sps->pic_height_in_luma_samples) return false; - int minBlockAddrN = pps.MinTbAddrZS[ (xN>>sps.Log2MinTrafoSize) + - (yN>>sps.Log2MinTrafoSize) * sps.PicWidthInTbsY ]; - int minBlockAddrCurr = pps.MinTbAddrZS[ (xCurr>>sps.Log2MinTrafoSize) + - (yCurr>>sps.Log2MinTrafoSize) * sps.PicWidthInTbsY ]; + int minBlockAddrN = pps->MinTbAddrZS[ (xN>>sps->Log2MinTrafoSize) + + (yN>>sps->Log2MinTrafoSize) * sps->PicWidthInTbsY ]; + int minBlockAddrCurr = pps->MinTbAddrZS[ (xCurr>>sps->Log2MinTrafoSize) + + (yCurr>>sps->Log2MinTrafoSize) * sps->PicWidthInTbsY ]; if (minBlockAddrN > minBlockAddrCurr) return false; - int xCurrCtb = xCurr >> sps.Log2CtbSizeY; - int yCurrCtb = yCurr >> sps.Log2CtbSizeY; - int xNCtb = xN >> sps.Log2CtbSizeY; - int yNCtb = yN >> sps.Log2CtbSizeY; + int xCurrCtb = xCurr >> sps->Log2CtbSizeY; + int yCurrCtb = yCurr >> sps->Log2CtbSizeY; + int xNCtb = xN >> sps->Log2CtbSizeY; + int yNCtb = yN >> sps->Log2CtbSizeY; if (get_SliceAddrRS(xCurrCtb,yCurrCtb) != get_SliceAddrRS(xNCtb, yNCtb)) { return false; }
View file
libde265-1.0.2.tar.gz/libde265/image.h -> libde265-1.0.3.tar.gz/libde265/image.h
Changed
@@ -29,9 +29,11 @@ #include <stdint.h> #include <stdlib.h> #include <string.h> +#include <memory> #ifdef HAVE_STDBOOL_H #include <stdbool.h> #endif + #include "libde265/de265.h" #include "libde265/en265.h" #include "libde265/sps.h" @@ -214,12 +216,6 @@ } CB_ref_info; -typedef struct { - MotionVectorSpec mv; // TODO: this can be done in 16x16 grid -} PB_ref_info; - -// intraPredMode: Used for determining scanIdx when decoding/encoding coefficients. - struct de265_image { @@ -228,7 +224,7 @@ de265_error alloc_image(int w,int h, enum de265_chroma c, - const seq_parameter_set* sps, + std::shared_ptr<const seq_parameter_set> sps, bool allocMetadata, decoder_context* dctx, class encoder_context* ectx, @@ -241,6 +237,14 @@ void release(); + void set_headers(std::shared_ptr<video_parameter_set> _vps, + std::shared_ptr<seq_parameter_set> _sps, + std::shared_ptr<pic_parameter_set> _pps) { + vps = _vps; + sps = _sps; + pps = _pps; + } + void fill_image(int y,int u,int v); de265_error copy_image(const de265_image* src); void copy_lines_from(const de265_image* src, int first, int end); @@ -304,8 +308,8 @@ enum de265_chroma get_chroma_format() const { return chroma_format; } int get_bit_depth(int cIdx) const { - if (cIdx==0) return sps.BitDepth_Y; - else return sps.BitDepth_C; + if (cIdx==0) return sps->BitDepth_Y; + else return sps->BitDepth_C; } int get_bytes_per_pixel(int cIdx) const { @@ -354,6 +358,8 @@ int stride, chroma_stride; public: + uint8_t BitDepth_Y, BitDepth_C; + uint8_t SubWidthC, SubHeightC; std::vector<slice_segment_header*> slices; public: @@ -376,18 +382,35 @@ int32_t removed_at_picture_id; - video_parameter_set vps; - seq_parameter_set sps; // the SPS used for decoding this image - pic_parameter_set pps; // the PPS used for decoding this image + const video_parameter_set& get_vps() const { return *vps; } + const seq_parameter_set& get_sps() const { return *sps; } + const pic_parameter_set& get_pps() const { return *pps; } + + bool has_vps() const { return (bool)vps; } + bool has_sps() const { return (bool)sps; } + bool has_pps() const { return (bool)pps; } + + std::shared_ptr<const seq_parameter_set> get_shared_sps() { return sps; } + + //std::shared_ptr<const seq_parameter_set> get_shared_sps() const { return sps; } + //std::shared_ptr<const pic_parameter_set> get_shared_pps() const { return pps; } + decoder_context* decctx; class encoder_context* encctx; int number_of_ctbs() const { return ctb_info.size(); } private: + // The image also keeps a reference to VPS/SPS/PPS, because when decoding is delayed, + // the currently active parameter sets in the decctx might already have been replaced + // with new parameters. + std::shared_ptr<const video_parameter_set> vps; + std::shared_ptr<const seq_parameter_set> sps; // the SPS used for decoding this image + std::shared_ptr<const pic_parameter_set> pps; // the PPS used for decoding this image + MetaDataArray<CTB_info> ctb_info; MetaDataArray<CB_ref_info> cb_info; - MetaDataArray<PB_ref_info> pb_info; + MetaDataArray<PBMotion> pb_info; MetaDataArray<uint8_t> intraPredMode; MetaDataArray<uint8_t> intraPredModeC; MetaDataArray<uint8_t> tu_info; @@ -621,12 +644,12 @@ enum IntraPredMode mode) { int pbSize = 1<<(log2blkSize - intraPredMode.log2unitSize); - int PUidx = (x0>>sps.Log2MinPUSize) + (y0>>sps.Log2MinPUSize)*sps.PicWidthInMinPUs; + int PUidx = (x0>>sps->Log2MinPUSize) + (y0>>sps->Log2MinPUSize)*sps->PicWidthInMinPUs; for (int y=0;y<pbSize;y++) for (int x=0;x<pbSize;x++) { - assert(x<sps.PicWidthInMinPUs); - assert(y<sps.PicHeightInMinPUs); + assert(x < sps->PicWidthInMinPUs); + assert(y < sps->PicHeightInMinPUs); int idx = PUidx + x + y*intraPredMode.width_in_units; assert(idx<intraPredMode.data_size); @@ -652,12 +675,12 @@ if (is_mode4) combinedValue |= 0x80; int pbSize = 1<<(log2blkSize - intraPredMode.log2unitSize); - int PUidx = (x0>>sps.Log2MinPUSize) + (y0>>sps.Log2MinPUSize)*sps.PicWidthInMinPUs; + int PUidx = (x0>>sps->Log2MinPUSize) + (y0>>sps->Log2MinPUSize)*sps->PicWidthInMinPUs; for (int y=0;y<pbSize;y++) for (int x=0;x<pbSize;x++) { - assert(x<sps.PicWidthInMinPUs); - assert(y<sps.PicHeightInMinPUs); + assert(x<sps->PicWidthInMinPUs); + assert(y<sps->PicHeightInMinPUs); int idx = PUidx + x + y*intraPredModeC.width_in_units; assert(idx<intraPredModeC.data_size); @@ -821,12 +844,12 @@ // --- PB metadata access --- - const MotionVectorSpec* get_mv_info(int x,int y) const + const PBMotion& get_mv_info(int x,int y) const { - return &pb_info.get(x,y).mv; + return pb_info.get(x,y); } - void set_mv_info(int x,int y, int nPbW,int nPbH, const MotionVectorSpec& mv); + void set_mv_info(int x,int y, int nPbW,int nPbH, const PBMotion& mv); // --- value logging ---
View file
libde265-1.0.2.tar.gz/libde265/intrapred.cc -> libde265-1.0.3.tar.gz/libde265/intrapred.cc
Changed
@@ -21,12 +21,18 @@ #include "intrapred.h" #include "transform.h" #include "util.h" +#include "encoder/encoder-types.h" #include <assert.h> #include <sys/types.h> #include <string.h> +// Actually, the largest TB block can only be 32, but in some intra-pred-mode algorithms +// (e.g. min-residual), we may call intra prediction on the maximum CTB size (64). +static const int MAX_INTRA_PRED_BLOCK_SIZE = 64; + + #ifdef DE265_LOG_TRACE template <class pixel_t> @@ -52,12 +58,58 @@ #endif -void fillIntraPredModeCandidates(int candModeList[3], int x,int y, int PUidx, + +void fillIntraPredModeCandidates(enum IntraPredMode candModeList[3], + enum IntraPredMode candIntraPredModeA, + enum IntraPredMode candIntraPredModeB) +{ + // build candidate list + + if (candIntraPredModeA == candIntraPredModeB) { + if (candIntraPredModeA < 2) { + candModeList[0] = INTRA_PLANAR; + candModeList[1] = INTRA_DC; + candModeList[2] = INTRA_ANGULAR_26; + } + else { + candModeList[0] = candIntraPredModeA; + candModeList[1] = (enum IntraPredMode)(2 + ((candIntraPredModeA-2 -1 +32) % 32)); + candModeList[2] = (enum IntraPredMode)(2 + ((candIntraPredModeA-2 +1 ) % 32)); + } + } + else { + candModeList[0] = candIntraPredModeA; + candModeList[1] = candIntraPredModeB; + + if (candIntraPredModeA != INTRA_PLANAR && + candIntraPredModeB != INTRA_PLANAR) { + candModeList[2] = INTRA_PLANAR; + } + else if (candIntraPredModeA != INTRA_DC && + candIntraPredModeB != INTRA_DC) { + candModeList[2] = INTRA_DC; + } + else { + candModeList[2] = INTRA_ANGULAR_26; + } + } + + /* + printf("candModeList: %d %d %d\n", + candModeList[0], + candModeList[1], + candModeList[2] + ); + */ +} + + +void fillIntraPredModeCandidates(enum IntraPredMode candModeList[3], int x,int y, int PUidx, bool availableA, // left bool availableB, // top const de265_image* img) { - const seq_parameter_set* sps = &img->sps; + const seq_parameter_set* sps = &img->get_sps(); // block on left side @@ -90,53 +142,85 @@ } - // build candidate list + logtrace(LogSlice,"%d;%d candA:%d / candB:%d\n", x,y, + availableA ? candIntraPredModeA : -999, + availableB ? candIntraPredModeB : -999); - logtrace(LogSlice,"%d;%d availableA:%d candA:%d & availableB:%d candB:%d\n", x,y, - availableA, candIntraPredModeA, - availableB, candIntraPredModeB); - if (candIntraPredModeA == candIntraPredModeB) { - if (candIntraPredModeA < 2) { - candModeList[0] = INTRA_PLANAR; - candModeList[1] = INTRA_DC; - candModeList[2] = INTRA_ANGULAR_26; + fillIntraPredModeCandidates(candModeList, + candIntraPredModeA, + candIntraPredModeB); +} + + +void fillIntraPredModeCandidates(enum IntraPredMode candModeList[3], + int x,int y, + bool availableA, // left + bool availableB, // top + const CTBTreeMatrix& ctbs, + const seq_parameter_set* sps) +{ + + // block on left side + + enum IntraPredMode candIntraPredModeA, candIntraPredModeB; + + if (availableA==false) { + candIntraPredModeA=INTRA_DC; + } + else { + const enc_cb* cbL = ctbs.getCB(x-1,y); + assert(cbL != NULL); + + if (cbL->PredMode != MODE_INTRA || + cbL->pcm_flag) { + candIntraPredModeA=INTRA_DC; } else { - candModeList[0] = candIntraPredModeA; - candModeList[1] = 2 + ((candIntraPredModeA-2 -1 +32) % 32); - candModeList[2] = 2 + ((candIntraPredModeA-2 +1 ) % 32); + const enc_tb* tbL = cbL->getTB(x-1,y); + assert(tbL); + candIntraPredModeA = tbL->intra_mode; } } + + // block above + + if (availableB==false) { + candIntraPredModeB=INTRA_DC; + } else { - candModeList[0] = candIntraPredModeA; - candModeList[1] = candIntraPredModeB; + const enc_cb* cbA = ctbs.getCB(x,y-1); + assert(cbA != NULL); - if (candIntraPredModeA != INTRA_PLANAR && - candIntraPredModeB != INTRA_PLANAR) { - candModeList[2] = INTRA_PLANAR; + if (cbA->PredMode != MODE_INTRA || + cbA->pcm_flag) { + candIntraPredModeB=INTRA_DC; } - else if (candIntraPredModeA != INTRA_DC && - candIntraPredModeB != INTRA_DC) { - candModeList[2] = INTRA_DC; + else if (y-1 < ((y >> sps->Log2CtbSizeY) << sps->Log2CtbSizeY)) { + candIntraPredModeB=INTRA_DC; } else { - candModeList[2] = INTRA_ANGULAR_26; + const enc_tb* tbA = cbA->getTB(x,y-1); + assert(tbA); + + candIntraPredModeB = tbA->intra_mode; } } - /* - printf("candModeList: %d %d %d\n", - candModeList[0], - candModeList[1], - candModeList[2] - ); - */ + + logtrace(LogSlice,"%d;%d candA:%d / candB:%d\n", x,y, + availableA ? candIntraPredModeA : -999, + availableB ? candIntraPredModeB : -999); + + + fillIntraPredModeCandidates(candModeList, + candIntraPredModeA, + candIntraPredModeB); } int find_intra_pred_mode(enum IntraPredMode mode, - int candModeList[3]) + enum IntraPredMode candModeList[3]) { // check whether the mode is in the candidate list @@ -257,29 +341,107 @@ } -// (8.4.4.2.2)
View file
libde265-1.0.2.tar.gz/libde265/intrapred.h -> libde265-1.0.3.tar.gz/libde265/intrapred.h
Changed
@@ -31,23 +31,31 @@ block (which is (x>>Log2MinPUSize) + (y>>Log2MinPUSize)*PicWidthInMinPUs). availableA/B is the output of check_CTB_available(). */ -void fillIntraPredModeCandidates(int candModeList[3], +void fillIntraPredModeCandidates(enum IntraPredMode candModeList[3], int x,int y, int PUidx, bool availableA, // left bool availableB, // top const de265_image* img); -inline void fillIntraPredModeCandidates(int candModeList[3], int x,int y, +inline void fillIntraPredModeCandidates(enum IntraPredMode candModeList[3], int x,int y, bool availableA, // left bool availableB, // top const de265_image* img) { - int PUidx = img->sps.getPUIndexRS(x,y); + int PUidx = img->get_sps().getPUIndexRS(x,y); fillIntraPredModeCandidates(candModeList, x,y, PUidx, availableA,availableB, img); } +void fillIntraPredModeCandidates(enum IntraPredMode candModeList[3], + int x,int y, + bool availableA, // left + bool availableB, // top + const class CTBTreeMatrix& ctbs, + const seq_parameter_set* sps); + + /* Return value >= 0 -> use mpm_idx(return value) else -> use rem_intra(-return value-1) @@ -55,7 +63,7 @@ This function may modify the candModeList ! */ int find_intra_pred_mode(enum IntraPredMode mode, - int candModeList[3]); + enum IntraPredMode candModeList[3]); void list_chroma_pred_candidates(enum IntraPredMode chroma_mode[5], enum IntraPredMode luma_mode); @@ -69,6 +77,7 @@ enum IntraPredMode lumaPredMode_to_chromaPredMode(enum IntraPredMode luma, enum IntraChromaPredMode chroma); +/* void decode_intra_block(decoder_context* ctx, thread_context* tctx, int cIdx, @@ -77,6 +86,7 @@ int log2TrafoSize, int trafoDepth, enum IntraPredMode intraPredMode, bool transform_skip_flag); +*/ //void fill_border_samples(decoder_context* ctx, int xB,int yB, // int nT, int cIdx, uint8_t* out_border); @@ -86,4 +96,16 @@ enum IntraPredMode intraPredMode, int nT, int cIdx); +void decode_intra_prediction_from_tree(const de265_image* img, + const class enc_tb* tb, + const class CTBTreeMatrix& ctbs, + const class seq_parameter_set& sps, + int cIdx); + +// TODO: remove this +template <class pixel_t> void decode_intra_prediction(de265_image* img, + int xB0,int yB0, + enum IntraPredMode intraPredMode, + pixel_t* dst, int nT, int cIdx); + #endif
View file
libde265-1.0.2.tar.gz/libde265/motion.cc -> libde265-1.0.3.tar.gz/libde265/motion.cc
Changed
@@ -22,6 +22,8 @@ #include "decctx.h" #include "util.h" #include "dpb.h" +#include "encoder/encoder-context.h" + #include <assert.h> @@ -31,7 +33,7 @@ #if defined(_MSC_VER) || defined(__MINGW32__) # include <malloc.h> -#else +#elif defined(HAVE_ALLOCA_H) # include <alloca.h> #endif @@ -280,7 +282,7 @@ int xC,int yC, int xB,int yB, int nCS, int nPbW,int nPbH, - const MotionVectorSpec* vi) + const PBMotion* vi) { int xP = xC+xB; int yP = yC+yB; @@ -288,8 +290,11 @@ void* pixels[3]; int stride[3]; - const int SubWidthC = img->sps.SubWidthC; - const int SubHeightC = img->sps.SubHeightC; + const pic_parameter_set* pps = shdr->pps; + const seq_parameter_set* sps = pps->sps; + + const int SubWidthC = sps->SubWidthC; + const int SubHeightC = sps->SubHeightC; pixels[0] = img->get_image_plane_at_pos_any_depth(0,xP,yP); stride[0] = img->get_image_stride(0); @@ -311,14 +316,14 @@ predFlag[0] = vi->predFlag[0]; predFlag[1] = vi->predFlag[1]; - const int bit_depth_L = img->sps.BitDepth_Y; - const int bit_depth_C = img->sps.BitDepth_C; + const int bit_depth_L = sps->BitDepth_Y; + const int bit_depth_C = sps->BitDepth_C; // Some encoders use bi-prediction with two similar MVs. // Identify this case and use only one MV. // do this only without weighted prediction, because the weights/offsets may be different - if (img->pps.weighted_pred_flag==0) { + if (pps->weighted_pred_flag==0) { if (predFlag[0] && predFlag[1]) { if (vi->mv[0].x == vi->mv[1].x && vi->mv[0].y == vi->mv[1].y && @@ -360,31 +365,31 @@ // TODO: must predSamples stride really be nCS or can it be somthing smaller like nPbW? if (img->high_bit_depth(0)) { - mc_luma(ctx, &img->sps, vi->mv[l].x, vi->mv[l].y, xP,yP, + mc_luma(ctx, sps, vi->mv[l].x, vi->mv[l].y, xP,yP, predSamplesL[l],nCS, (const uint16_t*)refPic->get_image_plane(0), refPic->get_luma_stride(), nPbW,nPbH, bit_depth_L); } else { - mc_luma(ctx, &img->sps, vi->mv[l].x, vi->mv[l].y, xP,yP, + mc_luma(ctx, sps, vi->mv[l].x, vi->mv[l].y, xP,yP, predSamplesL[l],nCS, (const uint8_t*)refPic->get_image_plane(0), refPic->get_luma_stride(), nPbW,nPbH, bit_depth_L); } if (img->high_bit_depth(0)) { - mc_chroma(ctx, &img->sps, vi->mv[l].x, vi->mv[l].y, xP,yP, + mc_chroma(ctx, sps, vi->mv[l].x, vi->mv[l].y, xP,yP, predSamplesC[0][l],nCS, (const uint16_t*)refPic->get_image_plane(1), refPic->get_chroma_stride(), nPbW/SubWidthC,nPbH/SubHeightC, bit_depth_C); - mc_chroma(ctx, &img->sps, vi->mv[l].x, vi->mv[l].y, xP,yP, + mc_chroma(ctx, sps, vi->mv[l].x, vi->mv[l].y, xP,yP, predSamplesC[1][l],nCS, (const uint16_t*)refPic->get_image_plane(2), refPic->get_chroma_stride(), nPbW/SubWidthC,nPbH/SubHeightC, bit_depth_C); } else { - mc_chroma(ctx, &img->sps, vi->mv[l].x, vi->mv[l].y, xP,yP, + mc_chroma(ctx, sps, vi->mv[l].x, vi->mv[l].y, xP,yP, predSamplesC[0][l],nCS, (const uint8_t*)refPic->get_image_plane(1), refPic->get_chroma_stride(), nPbW/SubWidthC,nPbH/SubHeightC, bit_depth_C); - mc_chroma(ctx, &img->sps, vi->mv[l].x, vi->mv[l].y, xP,yP, + mc_chroma(ctx, sps, vi->mv[l].x, vi->mv[l].y, xP,yP, predSamplesC[1][l],nCS, (const uint8_t*)refPic->get_image_plane(2), refPic->get_chroma_stride(), nPbW/SubWidthC,nPbH/SubHeightC, bit_depth_C); } @@ -395,10 +400,10 @@ // weighted sample prediction (8.5.3.2.3) - const int shift1_L = libde265_max(2,14-img->sps.BitDepth_Y); - const int offset_shift1_L = img->sps.WpOffsetBdShiftY; - const int shift1_C = libde265_max(2,14-img->sps.BitDepth_C); - const int offset_shift1_C = img->sps.WpOffsetBdShiftC; + const int shift1_L = libde265_max(2,14-sps->BitDepth_Y); + const int offset_shift1_L = img->get_sps().WpOffsetBdShiftY; + const int shift1_C = libde265_max(2,14-sps->BitDepth_C); + const int offset_shift1_C = img->get_sps().WpOffsetBdShiftC; /* const int shift1_L = 14-img->sps.BitDepth_Y; @@ -433,7 +438,7 @@ logtrace(LogMotion,"predFlags (modified): %d %d\n", predFlag[0], predFlag[1]); if (shdr->slice_type == SLICE_TYPE_P) { - if (img->pps.weighted_pred_flag==0) { + if (pps->weighted_pred_flag==0) { if (predFlag[0]==1 && predFlag[1]==0) { ctx->acceleration.put_unweighted_pred(pixels[0], stride[0], predSamplesL[0],nCS, nPbW,nPbH, bit_depth_L); @@ -489,7 +494,7 @@ assert(shdr->slice_type == SLICE_TYPE_B); if (predFlag[0]==1 && predFlag[1]==1) { - if (img->pps.weighted_bipred_flag==0) { + if (pps->weighted_bipred_flag==0) { //const int shift2 = 15-8; // TODO: real bit depth //const int offset2 = 1<<(shift2-1); @@ -566,7 +571,7 @@ else if (predFlag[0]==1 || predFlag[1]==1) { int l = predFlag[0] ? 0 : 1; - if (img->pps.weighted_bipred_flag==0) { + if (pps->weighted_bipred_flag==0) { ctx->acceleration.put_unweighted_pred(pixels[0], stride[0], predSamplesL[l],nCS, nPbW,nPbH, bit_depth_L); ctx->acceleration.put_unweighted_pred(pixels[1], stride[1], @@ -657,7 +662,7 @@ #ifdef DE265_LOG_TRACE -void logmvcand(const MotionVectorSpec& p) +void logmvcand(const PBMotion& p) { for (int v=0;v<2;v++) { if (p.predFlag[v]) { @@ -673,17 +678,19 @@ #endif -LIBDE265_INLINE static bool equal_cand_MV(const MotionVectorSpec* a, const MotionVectorSpec* b) +bool PBMotion::operator==(const PBMotion& b) const { + const PBMotion& a = *this; + // TODO: is this really correct? no check for predFlag? Standard says so... (p.127) for (int i=0;i<2;i++) { - if (a->predFlag[i] != b->predFlag[i]) return false; + if (a.predFlag[i] != b.predFlag[i]) return false; - if (a->predFlag[i]) { - if (a->mv[i].x != b->mv[i].x) return false; - if (a->mv[i].y != b->mv[i].y) return false; - if (a->refIdx[i] != b->refIdx[i]) return false; + if (a.predFlag[i]) { + if (a.mv[i].x != b.mv[i].x) return false; + if (a.mv[i].y != b.mv[i].y) return false; + if (a.refIdx[i] != b.refIdx[i]) return false; } } @@ -691,6 +698,43 @@ } +// TODO: add specializations for de265_image and encoder_context +template <class T> class MotionVectorAccess +{ +public: + enum PartMode get_PartMode(int x,int y); + const PBMotion& get_mv_info(int x,int y); +}; + + +template <> class MotionVectorAccess<de265_image> +{ +public: + MotionVectorAccess(const de265_image* i) : img(i) { } + + enum PartMode get_PartMode(int x,int y) { return img->get_PartMode(x,y); } + const PBMotion& get_mv_info(int x,int y) { return img->get_mv_info(x,y); } + +private: + const de265_image* img; +}; + +
View file
libde265-1.0.2.tar.gz/libde265/motion.h -> libde265-1.0.3.tar.gz/libde265/motion.h
Changed
@@ -26,30 +26,44 @@ class base_context; class slice_segment_header; -typedef struct +class MotionVector { + public: int16_t x,y; -} MotionVector; +}; -typedef struct +class PBMotion { + public: uint8_t predFlag[2]; // which of the two vectors is actually used - int8_t refIdx[2]; - MotionVector mv[2]; -} MotionVectorSpec; + int8_t refIdx[2]; // index into RefPicList + MotionVector mv[2]; // the absolute motion vectors + bool operator==(const PBMotion&) const; +}; -typedef struct { + +class PBMotionCoding +{ + public: + // index into RefPicList int8_t refIdx[2]; + + // motion vector difference int16_t mvd[2][2]; // [L0/L1][x/y] (only in top left position - ???) - uint8_t inter_pred_idc : 2; // enum InterPredIdc + // enum InterPredIdc, whether this is prediction from L0,L1, or BI + uint8_t inter_pred_idc : 2; + + // which of the two MVPs is used uint8_t mvp_l0_flag : 1; uint8_t mvp_l1_flag : 1; + + // whether merge mode is used uint8_t merge_flag : 1; uint8_t merge_idx : 3; -} motion_spec; +}; void get_merge_candidate_list(base_context* ctx, @@ -57,7 +71,13 @@ struct de265_image* img, int xC,int yC, int xP,int yP, int nCS, int nPbW,int nPbH, int partIdx, - MotionVectorSpec* mergeCandList); + PBMotion* mergeCandList); + +void get_merge_candidate_list_from_tree(class encoder_context* ectx, + const slice_segment_header* shdr, + int xC,int yC, int xP,int yP, + int nCS, int nPbW,int nPbH, int partIdx, + PBMotion* mergeCandList); /* int derive_spatial_merging_candidates(const struct de265_image* img, @@ -75,7 +95,7 @@ int xC,int yC, int xB,int yB, int nCS, int nPbW,int nPbH, - const MotionVectorSpec* vi); + const PBMotion* vi); /* Fill list (two entries) of motion-vector predictors for MVD coding. @@ -90,7 +110,7 @@ void decode_prediction_unit(base_context* ctx,const slice_segment_header* shdr, - de265_image* img, const motion_spec& motion, + de265_image* img, const PBMotionCoding& motion, int xC,int yC, int xB,int yB, int nCS, int nPbW,int nPbH, int partIdx); #endif
View file
libde265-1.0.2.tar.gz/libde265/pps.cc -> libde265-1.0.3.tar.gz/libde265/pps.cc
Changed
@@ -27,7 +27,7 @@ #include <string.h> #if defined(_MSC_VER) || defined(__MINGW32__) # include <malloc.h> -#else +#elif defined(HAVE_ALLOCA_H) # include <alloca.h> #endif @@ -191,6 +191,7 @@ void pic_parameter_set::set_defaults(enum PresetSet) { pps_read = false; + sps = NULL; pic_parameter_set_id = 0; seq_parameter_set_id = 0; @@ -306,12 +307,13 @@ num_ref_idx_l1_default_active++; - seq_parameter_set* sps = ctx->get_sps(seq_parameter_set_id); - if (sps->sps_read==false) { + if (!ctx->has_sps(seq_parameter_set_id)) { ctx->add_warning(DE265_WARNING_NONEXISTING_SPS_REFERENCED, false); return false; } + sps = ctx->get_sps(seq_parameter_set_id); + if ((pic_init_qp = get_svlc(br)) == UVLC_ERROR) { ctx->add_warning(DE265_WARNING_PPS_HEADER_INVALID, false); return false;
View file
libde265-1.0.2.tar.gz/libde265/pps.h -> libde265-1.0.3.tar.gz/libde265/pps.h
Changed
@@ -72,6 +72,8 @@ void set_defaults(enum PresetSet = Preset_Default); bool pps_read; // whether this pps has been read from bitstream + const seq_parameter_set* sps; + char pic_parameter_set_id; char seq_parameter_set_id;
View file
libde265-1.0.2.tar.gz/libde265/quality.cc -> libde265-1.0.3.tar.gz/libde265/quality.cc
Changed
@@ -109,4 +109,3 @@ img2->get_image_plane_at_pos(cIdx,x0,y0), img2->get_image_stride(cIdx), 1<<log2size, 1<<log2size); } -
View file
libde265-1.0.2.tar.gz/libde265/refpic.cc -> libde265-1.0.3.tar.gz/libde265/refpic.cc
Changed
@@ -26,7 +26,7 @@ #include <stdlib.h> #if defined(_MSC_VER) || defined(__MINGW32__) # include <malloc.h> -#else +#elif defined(HAVE_ALLOCA_H) # include <alloca.h> #endif @@ -255,6 +255,13 @@ int num_negative_pics = get_uvlc(br); int num_positive_pics = get_uvlc(br); + if (num_negative_pics == UVLC_ERROR || + num_positive_pics == UVLC_ERROR) { + // invalid num-ref-pics value + errqueue->add_warning(DE265_WARNING_MAX_NUM_REF_PICS_EXCEEDED, false); + return false; + } + // total number of reference pictures may not exceed buffer capacity if (num_negative_pics + num_positive_pics > sps->sps_max_dec_pic_buffering[ sps->sps_max_sub_layers-1 ]) {
View file
libde265-1.0.2.tar.gz/libde265/sao.cc -> libde265-1.0.3.tar.gz/libde265/sao.cc
Changed
@@ -41,8 +41,8 @@ return; } - const seq_parameter_set* sps = &img->sps; - const pic_parameter_set* pps = &img->pps; + const seq_parameter_set* sps = &img->get_sps(); + const pic_parameter_set* pps = &img->get_pps(); const int bitDepth = (cIdx==0 ? sps->BitDepth_Y : sps->BitDepth_C); const int maxPixelValue = (1<<bitDepth)-1; @@ -275,7 +275,9 @@ void apply_sample_adaptive_offset(de265_image* img) { - if (img->sps.sample_adaptive_offset_enabled_flag==0) { + const seq_parameter_set& sps = img->get_sps(); + + if (sps.sample_adaptive_offset_enabled_flag==0) { return; } @@ -286,20 +288,20 @@ return; } - for (int yCtb=0; yCtb<img->sps.PicHeightInCtbsY; yCtb++) - for (int xCtb=0; xCtb<img->sps.PicWidthInCtbsY; xCtb++) + for (int yCtb=0; yCtb<sps.PicHeightInCtbsY; yCtb++) + for (int xCtb=0; xCtb<sps.PicWidthInCtbsY; xCtb++) { const slice_segment_header* shdr = img->get_SliceHeaderCtb(xCtb,yCtb); if (shdr->slice_sao_luma_flag) { - apply_sao(img, xCtb,yCtb, shdr, 0, 1<<img->sps.Log2CtbSizeY, 1<<img->sps.Log2CtbSizeY, + apply_sao(img, xCtb,yCtb, shdr, 0, 1<<sps.Log2CtbSizeY, 1<<sps.Log2CtbSizeY, inputCopy.get_image_plane(0), inputCopy.get_image_stride(0), img->get_image_plane(0), img->get_image_stride(0)); } if (shdr->slice_sao_chroma_flag) { - int nSW = (1<<img->sps.Log2CtbSizeY) / img->sps.SubWidthC; - int nSH = (1<<img->sps.Log2CtbSizeY) / img->sps.SubHeightC; + int nSW = (1<<sps.Log2CtbSizeY) / sps.SubWidthC; + int nSH = (1<<sps.Log2CtbSizeY) / sps.SubHeightC; apply_sao(img, xCtb,yCtb, shdr, 1, nSW,nSH, inputCopy.get_image_plane(1), inputCopy.get_image_stride(1), @@ -315,7 +317,9 @@ void apply_sample_adaptive_offset_sequential(de265_image* img) { - if (img->sps.sample_adaptive_offset_enabled_flag==0) { + const seq_parameter_set& sps = img->get_sps(); + + if (sps.sample_adaptive_offset_enabled_flag==0) { return; } @@ -330,7 +334,7 @@ int nChannels = 3; - if (img->sps.ChromaArrayType == CHROMA_MONO) { nChannels=1; } + if (sps.ChromaArrayType == CHROMA_MONO) { nChannels=1; } for (int cIdx=0;cIdx<nChannels;cIdx++) { @@ -339,21 +343,21 @@ memcpy(inputCopy, img->get_image_plane(cIdx), stride * height * img->get_bytes_per_pixel(cIdx)); - for (int yCtb=0; yCtb<img->sps.PicHeightInCtbsY; yCtb++) - for (int xCtb=0; xCtb<img->sps.PicWidthInCtbsY; xCtb++) + for (int yCtb=0; yCtb<sps.PicHeightInCtbsY; yCtb++) + for (int xCtb=0; xCtb<sps.PicWidthInCtbsY; xCtb++) { const slice_segment_header* shdr = img->get_SliceHeaderCtb(xCtb,yCtb); if (shdr==NULL) { return; } if (cIdx==0 && shdr->slice_sao_luma_flag) { - apply_sao(img, xCtb,yCtb, shdr, 0, 1<<img->sps.Log2CtbSizeY, 1<<img->sps.Log2CtbSizeY, + apply_sao(img, xCtb,yCtb, shdr, 0, 1<<sps.Log2CtbSizeY, 1<<sps.Log2CtbSizeY, inputCopy, stride, img->get_image_plane(0), img->get_image_stride(0)); } if (cIdx!=0 && shdr->slice_sao_chroma_flag) { - int nSW = (1<<img->sps.Log2CtbSizeY) / img->sps.SubWidthC; - int nSH = (1<<img->sps.Log2CtbSizeY) / img->sps.SubHeightC; + int nSW = (1<<sps.Log2CtbSizeY) / sps.SubWidthC; + int nSH = (1<<sps.Log2CtbSizeY) / sps.SubHeightC; apply_sao(img, xCtb,yCtb, shdr, cIdx, nSW,nSH, inputCopy, stride, @@ -394,8 +398,10 @@ state = Running; img->thread_run(this); - const int rightCtb = img->sps.PicWidthInCtbsY-1; - const int ctbSize = (1<<img->sps.Log2CtbSizeY); + const seq_parameter_set& sps = img->get_sps(); + + const int rightCtb = sps.PicWidthInCtbsY-1; + const int ctbSize = (1<<sps.Log2CtbSizeY); // wait until also the CTB-rows below and above are ready @@ -406,7 +412,7 @@ img->wait_for_progress(this, rightCtb,ctb_y-1, inputProgress); } - if (ctb_y+1<img->sps.PicHeightInCtbsY) { + if (ctb_y+1<sps.PicHeightInCtbsY) { img->wait_for_progress(this, rightCtb,ctb_y+1, inputProgress); } @@ -418,7 +424,7 @@ // process SAO in the CTB-row - for (int xCtb=0; xCtb<img->sps.PicWidthInCtbsY; xCtb++) + for (int xCtb=0; xCtb<sps.PicWidthInCtbsY; xCtb++) { const slice_segment_header* shdr = img->get_SliceHeaderCtb(xCtb,ctb_y); if (shdr==NULL) { @@ -432,8 +438,8 @@ } if (shdr->slice_sao_chroma_flag) { - int nSW = ctbSize / img->sps.SubWidthC; - int nSH = ctbSize / img->sps.SubHeightC; + int nSW = ctbSize / sps.SubWidthC; + int nSH = ctbSize / sps.SubHeightC; apply_sao(img, xCtb,ctb_y, shdr, 1, nSW,nSH, inputImg ->get_image_plane(1), inputImg ->get_image_stride(1), @@ -449,7 +455,7 @@ // mark SAO progress for (int x=0;x<=rightCtb;x++) { - const int CtbWidth = img->sps.PicWidthInCtbsY; + const int CtbWidth = sps.PicWidthInCtbsY; img->ctb_progress[x+ctb_y*CtbWidth].set_progress(CTB_PROGRESS_SAO); } @@ -462,8 +468,9 @@ bool add_sao_tasks(image_unit* imgunit, int saoInputProgress) { de265_image* img = imgunit->img; + const seq_parameter_set& sps = img->get_sps(); - if (img->sps.sample_adaptive_offset_enabled_flag==0) { + if (sps.sample_adaptive_offset_enabled_flag==0) { return false; } @@ -471,7 +478,9 @@ decoder_context* ctx = img->decctx; de265_error err = imgunit->sao_output.alloc_image(img->get_width(), img->get_height(), - img->get_chroma_format(), &img->sps, false, + img->get_chroma_format(), + img->get_shared_sps(), + false, img->decctx, img->encctx, img->pts, img->user_data, true); if (err != DE265_OK) { @@ -479,7 +488,7 @@ return false; } - int nRows = img->sps.PicHeightInCtbsY; + int nRows = sps.PicHeightInCtbsY; int n=0; img->thread_start(nRows);
View file
libde265-1.0.2.tar.gz/libde265/sei.cc -> libde265-1.0.3.tar.gz/libde265/sei.cc
Changed
@@ -284,7 +284,7 @@ //write_picture(img); - int nHashes = img->sps.chroma_format_idc==0 ? 1 : 3; + int nHashes = img->get_sps().chroma_format_idc==0 ? 1 : 3; for (int i=0;i<nHashes;i++) { uint8_t* data; int w,h,stride;
View file
libde265-1.0.2.tar.gz/libde265/slice.cc -> libde265-1.0.3.tar.gz/libde265/slice.cc
Changed
@@ -244,6 +244,8 @@ void slice_segment_header::reset() { + pps = NULL; + slice_index = 0; first_slice_segment_in_pic_flag = 0; @@ -377,13 +379,14 @@ return DE265_OK; } - pic_parameter_set* pps = ctx->get_pps((int)slice_pic_parameter_set_id); - if (!pps->pps_read) { + if (!ctx->has_pps(slice_pic_parameter_set_id)) { ctx->add_warning(DE265_WARNING_NONEXISTING_PPS_REFERENCED, false); return DE265_OK; } - seq_parameter_set* sps = ctx->get_sps((int)pps->seq_parameter_set_id); + pps = ctx->get_pps(slice_pic_parameter_set_id); + + const seq_parameter_set* sps = pps->sps; if (!sps->sps_read) { ctx->add_warning(DE265_WARNING_NONEXISTING_SPS_REFERENCED, false); *continueDecoding = false; @@ -1700,13 +1703,15 @@ return bit ? PART_2Nx2N : PART_NxN; } else { + const seq_parameter_set& sps = img->get_sps(); + int bit0 = decode_CABAC_bit(&tctx->cabac_decoder, &tctx->ctx_model[CONTEXT_MODEL_PART_MODE+0]); if (bit0) { logtrace(LogSymbols,"$1 part_mode=%d\n",PART_2Nx2N); return PART_2Nx2N; } // CHECK_ME: I optimize code and fix bug here, need more VERIFY! int bit1 = decode_CABAC_bit(&tctx->cabac_decoder, &tctx->ctx_model[CONTEXT_MODEL_PART_MODE+1]); - if (cLog2CbSize > img->sps.Log2MinCbSizeY) { - if (!img->sps.amp_enabled_flag) { + if (cLog2CbSize > sps.Log2MinCbSizeY) { + if (!sps.amp_enabled_flag) { logtrace(LogSymbols,"$1 part_mode=%d\n",bit1 ? PART_2NxN : PART_Nx2N); return bit1 ? PART_2NxN : PART_Nx2N; } @@ -2660,20 +2665,20 @@ */ bool setCtbAddrFromTS(thread_context* tctx) { - const seq_parameter_set* sps = &tctx->img->sps; + const seq_parameter_set& sps = tctx->img->get_sps(); - if (tctx->CtbAddrInTS < sps->PicSizeInCtbsY) { - tctx->CtbAddrInRS = tctx->img->pps.CtbAddrTStoRS[tctx->CtbAddrInTS]; + if (tctx->CtbAddrInTS < sps.PicSizeInCtbsY) { + tctx->CtbAddrInRS = tctx->img->get_pps().CtbAddrTStoRS[tctx->CtbAddrInTS]; - tctx->CtbX = tctx->CtbAddrInRS % sps->PicWidthInCtbsY; - tctx->CtbY = tctx->CtbAddrInRS / sps->PicWidthInCtbsY; + tctx->CtbX = tctx->CtbAddrInRS % sps.PicWidthInCtbsY; + tctx->CtbY = tctx->CtbAddrInRS / sps.PicWidthInCtbsY; return false; } else { - tctx->CtbAddrInRS = sps->PicSizeInCtbsY; + tctx->CtbAddrInRS = sps.PicSizeInCtbsY; - tctx->CtbX = tctx->CtbAddrInRS % sps->PicWidthInCtbsY; - tctx->CtbY = tctx->CtbAddrInRS / sps->PicWidthInCtbsY; + tctx->CtbX = tctx->CtbAddrInRS % sps.PicWidthInCtbsY; + tctx->CtbY = tctx->CtbAddrInRS / sps.PicWidthInCtbsY; return true; } } @@ -2692,8 +2697,8 @@ { slice_segment_header* shdr = tctx->shdr; de265_image* img = tctx->img; - const seq_parameter_set* sps = &img->sps; - const pic_parameter_set* pps = &img->pps; + const seq_parameter_set& sps = img->get_sps(); + const pic_parameter_set& pps = img->get_pps(); logtrace(LogSlice,"# read_sao(%d,%d)\n",xCtb,yCtb); @@ -2708,8 +2713,8 @@ if (xCtb>0) { //char leftCtbInSliceSeg = (CtbAddrInSliceSeg>0); char leftCtbInSliceSeg = (tctx->CtbAddrInRS > shdr->SliceAddrRS); - char leftCtbInTile = (pps->TileIdRS[xCtb + yCtb * sps->PicWidthInCtbsY] == - pps->TileIdRS[xCtb-1 + yCtb * sps->PicWidthInCtbsY]); + char leftCtbInTile = (pps.TileIdRS[xCtb + yCtb * sps.PicWidthInCtbsY] == + pps.TileIdRS[xCtb-1 + yCtb * sps.PicWidthInCtbsY]); if (leftCtbInSliceSeg && leftCtbInTile) { sao_merge_left_flag = decode_sao_merge_flag(tctx); @@ -2720,11 +2725,11 @@ if (yCtb>0 && sao_merge_left_flag==0) { logtrace(LogSlice,"CtbAddrInRS:%d PicWidthInCtbsY:%d slice_segment_address:%d\n", tctx->CtbAddrInRS, - sps->PicWidthInCtbsY, + sps.PicWidthInCtbsY, shdr->slice_segment_address); - char upCtbInSliceSeg = (tctx->CtbAddrInRS - sps->PicWidthInCtbsY) >= shdr->SliceAddrRS; - char upCtbInTile = (pps->TileIdRS[xCtb + yCtb * sps->PicWidthInCtbsY] == - pps->TileIdRS[xCtb + (yCtb-1) * sps->PicWidthInCtbsY]); + char upCtbInSliceSeg = (tctx->CtbAddrInRS - sps.PicWidthInCtbsY) >= shdr->SliceAddrRS; + char upCtbInTile = (pps.TileIdRS[xCtb + yCtb * sps.PicWidthInCtbsY] == + pps.TileIdRS[xCtb + (yCtb-1) * sps.PicWidthInCtbsY]); if (upCtbInSliceSeg && upCtbInTile) { sao_merge_up_flag = decode_sao_merge_flag(tctx); @@ -2734,7 +2739,7 @@ if (!sao_merge_up_flag && !sao_merge_left_flag) { int nChroma = 3; - if (sps->ChromaArrayType == CHROMA_MONO) nChroma=1; + if (sps.ChromaArrayType == CHROMA_MONO) nChroma=1; for (int cIdx=0; cIdx<nChroma; cIdx++) { if ((shdr->slice_sao_luma_flag && cIdx==0) || @@ -2800,10 +2805,10 @@ int log2OffsetScale; if (cIdx==0) { - log2OffsetScale = pps->range_extension.log2_sao_offset_scale_luma; + log2OffsetScale = pps.range_extension.log2_sao_offset_scale_luma; } else { - log2OffsetScale = pps->range_extension.log2_sao_offset_scale_chroma; + log2OffsetScale = pps.range_extension.log2_sao_offset_scale_chroma; } for (int i=0;i<4;i++) { @@ -2831,12 +2836,12 @@ { slice_segment_header* shdr = tctx->shdr; de265_image* img = tctx->img; - seq_parameter_set* sps = &img->sps; + const seq_parameter_set& sps = img->get_sps(); - int xCtb = (tctx->CtbAddrInRS % sps->PicWidthInCtbsY); - int yCtb = (tctx->CtbAddrInRS / sps->PicWidthInCtbsY); - int xCtbPixels = xCtb << sps->Log2CtbSizeY; - int yCtbPixels = yCtb << sps->Log2CtbSizeY; + int xCtb = (tctx->CtbAddrInRS % sps.PicWidthInCtbsY); + int yCtb = (tctx->CtbAddrInRS / sps.PicWidthInCtbsY); + int xCtbPixels = xCtb << sps.Log2CtbSizeY; + int yCtbPixels = yCtb << sps.Log2CtbSizeY; logtrace(LogSlice,"----- decode CTB %d;%d (%d;%d) POC=%d, SliceAddrRS=%d\n", xCtbPixels,yCtbPixels, xCtb,yCtb, @@ -2853,7 +2858,7 @@ read_sao(tctx, xCtb,yCtb, CtbAddrInSliceSeg); } - read_coding_quadtree(tctx, xCtbPixels, yCtbPixels, sps->Log2CtbSizeY, 0); + read_coding_quadtree(tctx, xCtbPixels, yCtbPixels, sps.Log2CtbSizeY, 0); } @@ -2872,12 +2877,12 @@ // check whether neighbor is outside of frame if (xN < 0 || yN < 0) { return 0; } - if (xN >= img->sps.pic_width_in_luma_samples) { return 0; } - if (yN >= img->sps.pic_height_in_luma_samples) { return 0; } + if (xN >= img->get_sps().pic_width_in_luma_samples) { return 0; } + if (yN >= img->get_sps().pic_height_in_luma_samples) { return 0; } - int current_ctbAddrRS = luma_pos_to_ctbAddrRS(&img->sps, xC,yC); - int neighbor_ctbAddrRS = luma_pos_to_ctbAddrRS(&img->sps, xN,yN); + int current_ctbAddrRS = luma_pos_to_ctbAddrRS(&img->get_sps(), xC,yC); + int neighbor_ctbAddrRS = luma_pos_to_ctbAddrRS(&img->get_sps(), xN,yN); // TODO: check if this is correct (6.4.1) @@ -2888,8 +2893,8 @@ // check if both CTBs are in the same tile. - if (img->pps.TileIdRS[current_ctbAddrRS] != - img->pps.TileIdRS[neighbor_ctbAddrRS]) { + if (img->get_pps().TileIdRS[current_ctbAddrRS] != + img->get_pps().TileIdRS[neighbor_ctbAddrRS]) { return 0; } @@ -2907,8 +2912,8 @@ //slice_segment_header* shdr = tctx->shdr; de265_image* img = tctx->img; - const seq_parameter_set* sps = &img->sps; - const pic_parameter_set* pps = &img->pps; + const seq_parameter_set& sps = img->get_sps(); + const pic_parameter_set& pps = img->get_pps(); enum PredMode PredMode = img->get_pred_mode(x0,y0);
View file
libde265-1.0.2.tar.gz/libde265/slice.h -> libde265-1.0.3.tar.gz/libde265/slice.h
Changed
@@ -82,6 +82,9 @@ PART_nRx2N = 7 }; +const char* part_mode_name(enum PartMode); + + enum PredMode { MODE_INTRA, MODE_INTER, MODE_SKIP @@ -142,6 +145,8 @@ int slice_index; // index through all slices in a picture (internal only) + const pic_parameter_set* pps; + char first_slice_segment_in_pic_flag; char no_output_of_prior_pics_flag;
View file
libde265-1.0.2.tar.gz/libde265/sps.cc -> libde265-1.0.3.tar.gz/libde265/sps.cc
Changed
@@ -226,13 +226,6 @@ separate_colour_plane_flag = 0; } - if (separate_colour_plane_flag) { - ChromaArrayType = 0; - } - else { - ChromaArrayType = chroma_format_idc; - } - if (chroma_format_idc<0 || chroma_format_idc>3) { errqueue->add_warning(DE265_WARNING_INVALID_CHROMA_FORMAT, false); @@ -272,6 +265,11 @@ READ_VLC_OFFSET(bit_depth_luma, uvlc, 8); READ_VLC_OFFSET(bit_depth_chroma,uvlc, 8); + if (bit_depth_luma > 16 || + bit_depth_chroma > 16) { + errqueue->add_warning(DE265_WARNING_SPS_HEADER_INVALID, false); + return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE; + } READ_VLC_OFFSET(log2_max_pic_order_cnt_lsb, uvlc, 4); MaxPicOrderCntLsb = 1<<(log2_max_pic_order_cnt_lsb); @@ -458,13 +456,20 @@ } -de265_error seq_parameter_set::compute_derived_values() +de265_error seq_parameter_set::compute_derived_values(bool sanitize_values) { // --- compute derived values --- SubWidthC = SubWidthC_tab [chroma_format_idc]; SubHeightC = SubHeightC_tab[chroma_format_idc]; + if (separate_colour_plane_flag) { + ChromaArrayType = 0; + } + else { + ChromaArrayType = chroma_format_idc; + } + if (ChromaArrayType==0) { WinUnitX = 1; WinUnitY = 1; @@ -506,8 +511,35 @@ Log2MinTrafoSize = log2_min_transform_block_size; Log2MaxTrafoSize = log2_min_transform_block_size + log2_diff_max_min_transform_block_size; - if (max_transform_hierarchy_depth_inter > Log2CtbSizeY - Log2MinTrafoSize) { return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE; } - if (max_transform_hierarchy_depth_intra > Log2CtbSizeY - Log2MinTrafoSize) { return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE; } + if (max_transform_hierarchy_depth_inter > Log2CtbSizeY - Log2MinTrafoSize) { + if (sanitize_values) { + max_transform_hierarchy_depth_inter = Log2CtbSizeY - Log2MinTrafoSize; + } else { + fprintf(stderr,"SPS error: transform hierarchy depth (inter) > CTB size - min TB size\n"); + return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE; + } + } + + if (max_transform_hierarchy_depth_intra > Log2CtbSizeY - Log2MinTrafoSize) { + if (sanitize_values) { + max_transform_hierarchy_depth_intra = Log2CtbSizeY - Log2MinTrafoSize; + } else { + fprintf(stderr,"SPS error: transform hierarchy depth (intra) > CTB size - min TB size\n"); + return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE; + } + } + + + if (sanitize_values) { + if (max_transform_hierarchy_depth_inter < Log2CtbSizeY - Log2MaxTrafoSize) { + max_transform_hierarchy_depth_inter = Log2CtbSizeY - Log2MaxTrafoSize; + } + + if (max_transform_hierarchy_depth_intra < Log2CtbSizeY - Log2MaxTrafoSize) { + max_transform_hierarchy_depth_intra = Log2CtbSizeY - Log2MaxTrafoSize; + } + } + Log2MinPUSize = Log2MinCbSizeY-1; PicWidthInMinPUs = PicWidthInCtbsY << (Log2CtbSizeY - Log2MinPUSize); @@ -542,23 +574,28 @@ if (pic_width_in_luma_samples % MinCbSizeY != 0 || pic_height_in_luma_samples % MinCbSizeY != 0) { // TODO: warn that image size is coded wrong in bitstream (must be multiple of MinCbSizeY) + fprintf(stderr,"SPS error: CB alignment\n"); return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE; } if (Log2MinTrafoSize > Log2MinCbSizeY) { + fprintf(stderr,"SPS error: TB > CB\n"); return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE; } if (Log2MaxTrafoSize > libde265_min(Log2CtbSizeY,5)) { + fprintf(stderr,"SPS error: TB_max > 32 or CTB\n"); return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE; } if (BitDepth_Y < 8 || BitDepth_Y > 16) { + fprintf(stderr,"SPS error: bitdepth Y not in [8;16]\n"); return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE; } if (BitDepth_C < 8 || BitDepth_C > 16) { + fprintf(stderr,"SPS error: bitdepth C not in [8;16]\n"); return DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE; }
View file
libde265-1.0.2.tar.gz/libde265/sps.h -> libde265-1.0.3.tar.gz/libde265/sps.h
Changed
@@ -187,7 +187,7 @@ // --- derived values --- - de265_error compute_derived_values(); + de265_error compute_derived_values(bool sanitize_values = false); int BitDepth_Y; int QpBdOffset_Y;
View file
libde265-1.0.2.tar.gz/libde265/threads.cc -> libde265-1.0.3.tar.gz/libde265/threads.cc
Changed
@@ -24,7 +24,7 @@ #if defined(_MSC_VER) || defined(__MINGW32__) # include <malloc.h> -#else +#elif defined(HAVE_ALLOCA_H) # include <alloca.h> #endif @@ -310,6 +310,3 @@ } de265_mutex_unlock(&pool->mutex); } - -extern inline int de265_sync_sub_and_fetch(de265_sync_int* cnt, int n); -extern inline int de265_sync_add_and_fetch(de265_sync_int* cnt, int n);
View file
libde265-1.0.2.tar.gz/libde265/threads.h -> libde265-1.0.3.tar.gz/libde265/threads.h
Changed
@@ -33,6 +33,7 @@ #include <deque> #include <string> +#include <atomic> #ifndef _WIN32 #include <pthread.h> @@ -46,13 +47,6 @@ #include "../extra/win32cond.h" #if _MSC_VER > 1310 #include <intrin.h> -#else -extern "C" -{ - LONG __cdecl _InterlockedExchangeAdd(long volatile *Addend, LONG Value); -} -#pragma intrinsic (_InterlockedExchangeAdd) -#define InterlockedExchangeAdd _InterlockedExchangeAdd #endif typedef HANDLE de265_thread; @@ -77,30 +71,6 @@ void de265_cond_wait(de265_cond* c,de265_mutex* m); void de265_cond_signal(de265_cond* c); -typedef volatile long de265_sync_int; - -inline int de265_sync_sub_and_fetch(de265_sync_int* cnt, int n) -{ -#ifdef _WIN64 - return _InterlockedAdd(cnt, -n); -#elif _WIN32 - return _InterlockedExchangeAdd(cnt, -n) - n; -#else - return __sync_sub_and_fetch(cnt, n); -#endif -} - -inline int de265_sync_add_and_fetch(de265_sync_int* cnt, int n) -{ -#ifdef _WIN64 - return _InterlockedAdd(cnt, n); -#elif _WIN32 - return _InterlockedExchangeAdd(cnt, n) + n; -#else - return __sync_add_and_fetch(cnt, n); -#endif -} - class de265_progress_lock {
View file
libde265-1.0.2.tar.gz/libde265/transform.cc -> libde265-1.0.3.tar.gz/libde265/transform.cc
Changed
@@ -33,13 +33,13 @@ { logtrace(LogTransform,">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> decode_quantization_parameters(int xC,int yC)=(%d,%d)\n", xC,yC); - pic_parameter_set* pps = &tctx->img->pps; - seq_parameter_set* sps = &tctx->img->sps; + const pic_parameter_set& pps = tctx->img->get_pps(); + const seq_parameter_set& sps = tctx->img->get_sps(); slice_segment_header* shdr = tctx->shdr; // top left pixel position of current quantization group - int xQG = xCUBase - (xCUBase & ((1<<pps->Log2MinCuQpDeltaSize)-1)); - int yQG = yCUBase - (yCUBase & ((1<<pps->Log2MinCuQpDeltaSize)-1)); + int xQG = xCUBase - (xCUBase & ((1<<pps.Log2MinCuQpDeltaSize)-1)); + int yQG = yCUBase - (yCUBase & ((1<<pps.Log2MinCuQpDeltaSize)-1)); logtrace(LogTransform,"QG: %d,%d\n",xQG,yQG); @@ -69,35 +69,35 @@ // first QG in CTB row ? - int ctbLSBMask = ((1<<sps->Log2CtbSizeY)-1); + int ctbLSBMask = ((1<<sps.Log2CtbSizeY)-1); bool firstInCTBRow = (xQG == 0 && ((yQG & ctbLSBMask)==0)); // first QG in slice ? TODO: a "firstQG" flag in the thread context would be faster int first_ctb_in_slice_RS = tctx->shdr->SliceAddrRS; - int SliceStartX = (first_ctb_in_slice_RS % sps->PicWidthInCtbsY) * sps->CtbSizeY; - int SliceStartY = (first_ctb_in_slice_RS / sps->PicWidthInCtbsY) * sps->CtbSizeY; + int SliceStartX = (first_ctb_in_slice_RS % sps.PicWidthInCtbsY) * sps.CtbSizeY; + int SliceStartY = (first_ctb_in_slice_RS / sps.PicWidthInCtbsY) * sps.CtbSizeY; bool firstQGInSlice = (SliceStartX == xQG && SliceStartY == yQG); // first QG in tile ? bool firstQGInTile = false; - if (pps->tiles_enabled_flag) { - if ((xQG & ((1 << sps->Log2CtbSizeY)-1)) == 0 && - (yQG & ((1 << sps->Log2CtbSizeY)-1)) == 0) + if (pps.tiles_enabled_flag) { + if ((xQG & ((1 << sps.Log2CtbSizeY)-1)) == 0 && + (yQG & ((1 << sps.Log2CtbSizeY)-1)) == 0) { - int ctbX = xQG >> sps->Log2CtbSizeY; - int ctbY = yQG >> sps->Log2CtbSizeY; + int ctbX = xQG >> sps.Log2CtbSizeY; + int ctbY = yQG >> sps.Log2CtbSizeY; - firstQGInTile = pps->is_tile_start_CTB(ctbX,ctbY); // TODO: this is slow + firstQGInTile = pps.is_tile_start_CTB(ctbX,ctbY); // TODO: this is slow } } if (firstQGInSlice || firstQGInTile || - (firstInCTBRow && pps->entropy_coding_sync_enabled_flag)) { + (firstInCTBRow && pps.entropy_coding_sync_enabled_flag)) { qPY_PRED = tctx->shdr->SliceQPY; } else { @@ -108,10 +108,10 @@ int qPYA,qPYB; if (tctx->img->available_zscan(xQG,yQG, xQG-1,yQG)) { - int xTmp = (xQG-1) >> sps->Log2MinTrafoSize; - int yTmp = (yQG ) >> sps->Log2MinTrafoSize; - int minTbAddrA = pps->MinTbAddrZS[xTmp + yTmp*sps->PicWidthInTbsY]; - int ctbAddrA = minTbAddrA >> (2 * (sps->Log2CtbSizeY-sps->Log2MinTrafoSize)); + int xTmp = (xQG-1) >> sps.Log2MinTrafoSize; + int yTmp = (yQG ) >> sps.Log2MinTrafoSize; + int minTbAddrA = pps.MinTbAddrZS[xTmp + yTmp*sps.PicWidthInTbsY]; + int ctbAddrA = minTbAddrA >> (2 * (sps.Log2CtbSizeY-sps.Log2MinTrafoSize)); if (ctbAddrA == tctx->CtbAddrInTS) { qPYA = tctx->img->get_QPY(xQG-1,yQG); } @@ -124,10 +124,10 @@ } if (tctx->img->available_zscan(xQG,yQG, xQG,yQG-1)) { - int xTmp = (xQG ) >> sps->Log2MinTrafoSize; - int yTmp = (yQG-1) >> sps->Log2MinTrafoSize; - int minTbAddrB = pps->MinTbAddrZS[xTmp + yTmp*sps->PicWidthInTbsY]; - int ctbAddrB = minTbAddrB >> (2 * (sps->Log2CtbSizeY-sps->Log2MinTrafoSize)); + int xTmp = (xQG ) >> sps.Log2MinTrafoSize; + int yTmp = (yQG-1) >> sps.Log2MinTrafoSize; + int minTbAddrB = pps.MinTbAddrZS[xTmp + yTmp*sps.PicWidthInTbsY]; + int ctbAddrB = minTbAddrB >> (2 * (sps.Log2CtbSizeY-sps.Log2MinTrafoSize)); if (ctbAddrB == tctx->CtbAddrInTS) { qPYB = tctx->img->get_QPY(xQG,yQG-1); } @@ -143,21 +143,21 @@ logtrace(LogTransform,"qPY_PRED = %d (%d, %d)\n",qPY_PRED, qPYA, qPYB); - int QPY = ((qPY_PRED + tctx->CuQpDelta + 52+2*sps->QpBdOffset_Y) % - (52 + sps->QpBdOffset_Y)) - sps->QpBdOffset_Y; + int QPY = ((qPY_PRED + tctx->CuQpDelta + 52+2*sps.QpBdOffset_Y) % + (52 + sps.QpBdOffset_Y)) - sps.QpBdOffset_Y; - tctx->qPYPrime = QPY + sps->QpBdOffset_Y; + tctx->qPYPrime = QPY + sps.QpBdOffset_Y; - int qPiCb = Clip3(-sps->QpBdOffset_C,57, QPY+pps->pic_cb_qp_offset + shdr->slice_cb_qp_offset + tctx->CuQpOffsetCb); - int qPiCr = Clip3(-sps->QpBdOffset_C,57, QPY+pps->pic_cr_qp_offset + shdr->slice_cr_qp_offset + tctx->CuQpOffsetCr); + int qPiCb = Clip3(-sps.QpBdOffset_C,57, QPY+pps.pic_cb_qp_offset + shdr->slice_cb_qp_offset + tctx->CuQpOffsetCb); + int qPiCr = Clip3(-sps.QpBdOffset_C,57, QPY+pps.pic_cr_qp_offset + shdr->slice_cr_qp_offset + tctx->CuQpOffsetCr); logtrace(LogTransform,"qPiCb:%d (%d %d), qPiCr:%d (%d %d)\n", - qPiCb, pps->pic_cb_qp_offset, shdr->slice_cb_qp_offset, - qPiCr, pps->pic_cr_qp_offset, shdr->slice_cr_qp_offset); + qPiCb, pps.pic_cb_qp_offset, shdr->slice_cb_qp_offset, + qPiCr, pps.pic_cr_qp_offset, shdr->slice_cr_qp_offset); int qPCb,qPCr; - if (sps->ChromaArrayType == CHROMA_420) { + if (sps.ChromaArrayType == CHROMA_420) { qPCb = table8_22(qPiCb); qPCr = table8_22(qPiCr); } @@ -168,8 +168,8 @@ //printf("q: %d %d\n",qPiCb, qPCb); - tctx->qPCbPrime = qPCb + sps->QpBdOffset_C; - tctx->qPCrPrime = qPCr + sps->QpBdOffset_C; + tctx->qPCbPrime = qPCb + sps.QpBdOffset_C; + tctx->qPCrPrime = qPCr + sps.QpBdOffset_C; /* printf("Q: %d (%d %d %d / %d %d) %d %d %d\n",QPY, @@ -234,8 +234,8 @@ // TODO: make this an accelerated function void cross_comp_pred(const thread_context* tctx, int32_t* residual, int nT) { - const int BitDepthC = tctx->img->sps.BitDepth_C; - const int BitDepthY = tctx->img->sps.BitDepth_Y; + const int BitDepthC = tctx->img->get_sps().BitDepth_C; + const int BitDepthY = tctx->img->get_sps().BitDepth_Y; for (int y=0;y<nT;y++) for (int x=0;x<nT;x++) { @@ -356,8 +356,8 @@ int nT, int cIdx, bool transform_skip_flag, bool intra, int rdpcmMode) { - seq_parameter_set* sps = &tctx->img->sps; - pic_parameter_set* pps = &tctx->img->pps; + const seq_parameter_set& sps = tctx->img->get_sps(); + const pic_parameter_set& pps = tctx->img->get_pps(); int qP; switch (cIdx) { @@ -387,12 +387,12 @@ // We explicitly include the case for sizeof(pixel_t)==1 so that the compiler // can optimize away a lot of code for 8-bit pixels. - const int bit_depth = ((sizeof(pixel_t)==1) ? 8 : sps->get_bit_depth(cIdx)); + const int bit_depth = ((sizeof(pixel_t)==1) ? 8 : sps.get_bit_depth(cIdx)); //assert(intra == (tctx->img->get_pred_mode(xT,yT)==MODE_INTRA)); int cuPredModeIntra = (tctx->img->get_pred_mode(xT,yT)==MODE_INTRA); - bool rotateCoeffs = (sps->range_extension.transform_skip_rotation_enabled_flag && + bool rotateCoeffs = (sps.range_extension.transform_skip_rotation_enabled_flag && nT == 4 && cuPredModeIntra); @@ -440,7 +440,7 @@ else { // (8.6.3) - int bdShift = (cIdx==0 ? sps->BitDepth_Y : sps->BitDepth_C) + Log2(nT) - 5; + int bdShift = (cIdx==0 ? sps.BitDepth_Y : sps.BitDepth_C) + Log2(nT) - 5; logtrace(LogTransform,"bdShift=%d\n",bdShift); @@ -449,7 +449,7 @@ // --- inverse quantization --- - if (sps->scaling_list_enable_flag==0) { + if (sps.scaling_list_enable_flag==0) { //const int m_x_y = 16; const int m_x_y = 1; @@ -477,7 +477,7 @@ else { const int offset = (1<<(bdShift-1)); - uint8_t* sclist; + const uint8_t* sclist; int matrixID = cIdx; if (!intra) { if (nT<32) { matrixID += 3; } @@ -485,10 +485,10 @@
View file
libde265-1.0.2.tar.gz/libde265/util.cc -> libde265-1.0.3.tar.gz/libde265/util.cc
Changed
@@ -126,6 +126,11 @@ va_end(va); fflush(stdout); } + +bool logdebug_enabled(enum LogModule module) +{ + return verbosity>=2; +} #endif #ifdef DE265_LOG_TRACE @@ -173,13 +178,14 @@ -void printBlk(const char* title, const int16_t* data, int blksize, int stride) +void printBlk(const char* title, const int16_t* data, int blksize, int stride, + const std::string& prefix) { - printf("%s:\n",title); + if (title) printf("%s%s:\n",prefix.c_str(),title); for (int y=0;y<blksize;y++) { //logtrace(LogTransform," "); - printf(" "); + printf("%s",prefix.c_str()); for (int x=0;x<blksize;x++) { //logtrace(LogTransform,"*%3d ", data[x+y*stride]); printf("%4d ", data[x+y*stride]); @@ -190,13 +196,14 @@ } -void printBlk(const char* title, const int32_t* data, int blksize, int stride) +void printBlk(const char* title, const int32_t* data, int blksize, int stride, + const std::string& prefix) { - printf("%s:\n",title); + if (title) printf("%s%s:\n",prefix.c_str(),title); for (int y=0;y<blksize;y++) { //logtrace(LogTransform," "); - printf(" "); + printf("%s",prefix.c_str()); for (int x=0;x<blksize;x++) { //logtrace(LogTransform,"*%3d ", data[x+y*stride]); printf("%4d ", data[x+y*stride]); @@ -207,13 +214,14 @@ } -void printBlk(const char* title, const uint8_t* data, int blksize, int stride) +void printBlk(const char* title, const uint8_t* data, int blksize, int stride, + const std::string& prefix) { - printf("%s:\n",title); + if (title) printf("%s%s:\n",prefix.c_str(),title); for (int y=0;y<blksize;y++) { //logtrace(LogTransform," "); - printf(" "); + printf("%s",prefix.c_str()); for (int x=0;x<blksize;x++) { //logtrace(LogTransform,"*%3d ", data[x+y*stride]); printf("%02x ", data[x+y*stride]);
View file
libde265-1.0.2.tar.gz/libde265/util.h -> libde265-1.0.3.tar.gz/libde265/util.h
Changed
@@ -21,11 +21,16 @@ #ifndef DE265_UTIL_H #define DE265_UTIL_H +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #ifndef _MSC_VER #include <inttypes.h> #endif #include <stdio.h> +#include <string> #include "libde265/de265.h" @@ -51,6 +56,9 @@ #define LIBDE265_CHECK_RESULT #endif +// Be careful with these alignment instructions. They only specify the alignment within +// a struct. But they cannot make sure that the base address of the struct has the same alignment +// when it is dynamically allocated. #define ALIGNED_32( var ) LIBDE265_DECLARE_ALIGNED( var, 32 ) #define ALIGNED_16( var ) LIBDE265_DECLARE_ALIGNED( var, 16 ) #define ALIGNED_8( var ) LIBDE265_DECLARE_ALIGNED( var, 8 ) @@ -70,8 +78,22 @@ namespace std { using namespace std::tr1; } #endif -#if __GNUC__ && GCC_VERSION < 40600 -// nullptr was introduced in gcc 4.6, a simple alias should be fine for our use case +#ifdef NEED_STD_MOVE_FALLBACK +// Provide fallback variant of "std::move" for older compilers with +// incomplete/broken C++11 support. +namespace std { + +template<typename _Tp> +inline typename std::remove_reference<_Tp>::type&& move(_Tp&& __t) { + return static_cast<typename std::remove_reference<_Tp>::type&&>(__t); +} + +} // namespace std +#endif + +#ifdef NEED_NULLPTR_FALLBACK +// Compilers with partial/incomplete support for C++11 don't know about +// "nullptr". A simple alias should be fine for our use case. #define nullptr NULL #endif @@ -148,6 +170,7 @@ LogSymbols, LogCABAC, LogEncoder, + LogEncoderMetadata, NUMBER_OF_LogModules }; @@ -181,8 +204,10 @@ #ifdef DE265_LOG_DEBUG void logdebug(enum LogModule module, const char* string, ...); +bool logdebug_enabled(enum LogModule module); #else #define logdebug(a,b, ...) { } +inline bool logdebug_enabled(enum LogModule module) { return false; } #endif #ifdef DE265_LOG_TRACE @@ -194,9 +219,9 @@ void log2fh(FILE* fh, const char* string, ...); -void printBlk(const char* title,const int32_t* data, int blksize, int stride); -void printBlk(const char* title,const int16_t* data, int blksize, int stride); -void printBlk(const char* title,const uint8_t* data, int blksize, int stride); +void printBlk(const char* title,const int32_t* data, int blksize, int stride, const std::string& prefix=" "); +void printBlk(const char* title,const int16_t* data, int blksize, int stride, const std::string& prefix=" "); +void printBlk(const char* title,const uint8_t* data, int blksize, int stride, const std::string& prefix=" "); void debug_set_image_output(void (*)(const struct de265_image*, int slot)); void debug_show_image(const struct de265_image*, int slot);
View file
libde265-1.0.2.tar.gz/libde265/visualize.cc -> libde265-1.0.3.tar.gz/libde265/visualize.cc
Changed
@@ -92,7 +92,7 @@ { int yi = y + i; - if (yi < srcimg->sps.pic_height_in_luma_samples) { + if (yi < srcimg->get_sps().pic_height_in_luma_samples) { set_pixel(img,x,yi,stride,color,pixelSize); } } @@ -101,7 +101,7 @@ { int xi = x + i; - if (xi < srcimg->sps.pic_width_in_luma_samples) { + if (xi < srcimg->get_sps().pic_width_in_luma_samples) { set_pixel(img,xi,y,stride,color,pixelSize); } } @@ -152,7 +152,7 @@ { int dy = (slope*i+Sign(slope*i)*16)/32; int y = y0+w/2-dy; - if (y>=0 && y<srcimg->sps.pic_height_in_luma_samples) { + if (y>=0 && y<srcimg->get_sps().pic_height_in_luma_samples) { set_pixel(img, x0+i+w/2, y, stride, color, pixelSize); } } @@ -162,7 +162,7 @@ { int dx = (slope*i+Sign(slope*i)*16)/32; int x = x0+w/2-dx; - if (x>=0 && x<srcimg->sps.pic_width_in_luma_samples) { + if (x>=0 && x<srcimg->get_sps().pic_width_in_luma_samples) { set_pixel(img, x, y0+i+w/2, stride, color, pixelSize); } } @@ -292,20 +292,20 @@ tint_rect(img,stride, x0,y0,w,h, cols[predMode], pixelSize); } else if (what == PBMotionVectors) { - const MotionVectorSpec* mvi = srcimg->get_mv_info(x0,y0); + const PBMotion& mvi = srcimg->get_mv_info(x0,y0); int x = x0+w/2; int y = y0+h/2; - if (mvi->predFlag[0]) { + if (mvi.predFlag[0]) { draw_line(img,stride,0xFF0000,pixelSize, srcimg->get_width(), srcimg->get_height(), - x,y,x+mvi->mv[0].x,y+mvi->mv[0].y); + x,y,x+mvi.mv[0].x,y+mvi.mv[0].y); } - if (mvi->predFlag[1]) { + if (mvi.predFlag[1]) { draw_line(img,stride,0x00FF00,pixelSize, srcimg->get_width(), srcimg->get_height(), - x,y,x+mvi->mv[1].x,y+mvi->mv[1].y); + x,y,x+mvi.mv[1].x,y+mvi.mv[1].y); } } } @@ -314,11 +314,11 @@ void draw_tree_grid(const de265_image* srcimg, uint8_t* img, int stride, uint32_t color, int pixelSize, enum DrawMode what) { - const seq_parameter_set* sps = &srcimg->sps; - int minCbSize = sps->MinCbSizeY; + const seq_parameter_set& sps = srcimg->get_sps(); + int minCbSize = sps.MinCbSizeY; - for (int y0=0;y0<sps->PicHeightInMinCbsY;y0++) - for (int x0=0;x0<sps->PicWidthInMinCbsY;x0++) + for (int y0=0;y0<sps.PicHeightInMinCbsY;y0++) + for (int x0=0;x0<sps.PicWidthInMinCbsY;x0++) { int log2CbSize = srcimg->get_log2CbSize_cbUnits(x0,y0); if (log2CbSize==0) { @@ -456,16 +456,18 @@ LIBDE265_API void draw_Slices(const de265_image* img, uint8_t* dst, int stride, int pixelSize) { + const seq_parameter_set& sps = img->get_sps(); + // --- mark first CTB in slice (red - independent / green - dependent) --- - for (int ctby=0;ctby<img->sps.PicHeightInCtbsY;ctby++) - for (int ctbx=0;ctbx<img->sps.PicWidthInCtbsY;ctbx++) + for (int ctby=0;ctby<sps.PicHeightInCtbsY;ctby++) + for (int ctbx=0;ctbx<sps.PicWidthInCtbsY;ctbx++) { - const int blkw = img->sps.Log2CtbSizeY; + const int blkw = sps.Log2CtbSizeY; - int ctbAddrRS = ctby*img->sps.PicWidthInCtbsY + ctbx; + int ctbAddrRS = ctby*sps.PicWidthInCtbsY + ctbx; int prevCtbRS = -1; - if (ctbx>0 || ctby>0) { prevCtbRS = img->pps.CtbAddrTStoRS[ img->pps.CtbAddrRStoTS[ctbAddrRS] -1 ]; } + if (ctbx>0 || ctby>0) { prevCtbRS = img->get_pps().CtbAddrTStoRS[ img->get_pps().CtbAddrRStoTS[ctbAddrRS] -1 ]; } if (prevCtbRS<0 || img->get_SliceHeaderIndex_atIndex(ctbAddrRS) != @@ -483,8 +485,8 @@ int x1 = x + (ctbx<<blkw); int y1 = y + (ctby<<blkw); - if (x1<img->sps.pic_width_in_luma_samples && - y1<img->sps.pic_height_in_luma_samples) + if (x1<sps.pic_width_in_luma_samples && + y1<sps.pic_height_in_luma_samples) { set_pixel(dst,x1,y1,stride,fillcolor,pixelSize); } @@ -498,16 +500,16 @@ const uint32_t color = 0xff0000; - for (int ctby=0;ctby<img->sps.PicHeightInCtbsY;ctby++) - for (int ctbx=0;ctbx<img->sps.PicWidthInCtbsY;ctbx++) { + for (int ctby=0;ctby<sps.PicHeightInCtbsY;ctby++) + for (int ctbx=0;ctbx<sps.PicWidthInCtbsY;ctbx++) { if (ctbx>0 && (img->get_SliceHeaderIndexCtb(ctbx ,ctby) != img->get_SliceHeaderIndexCtb(ctbx-1,ctby))) { - int x = ctbx << img->sps.Log2CtbSizeY; - int y0 = ctby << img->sps.Log2CtbSizeY; + int x = ctbx << sps.Log2CtbSizeY; + int y0 = ctby << sps.Log2CtbSizeY; for (int y=y0; - (y<y0+(1<<img->sps.Log2CtbSizeY) && - y<img->sps.pic_height_in_luma_samples) ; + (y<y0+(1<<sps.Log2CtbSizeY) && + y<sps.pic_height_in_luma_samples) ; y++) { set_pixel(dst,x,y,stride,color,pixelSize); } @@ -515,16 +517,16 @@ } - for (int ctby=0;ctby<img->sps.PicHeightInCtbsY;ctby++) - for (int ctbx=0;ctbx<img->sps.PicWidthInCtbsY;ctbx++) { + for (int ctby=0;ctby<sps.PicHeightInCtbsY;ctby++) + for (int ctbx=0;ctbx<sps.PicWidthInCtbsY;ctbx++) { if (ctby>0 && (img->get_SliceHeaderIndexCtb(ctbx,ctby ) != img->get_SliceHeaderIndexCtb(ctbx,ctby-1))) { - int x0 = ctbx << img->sps.Log2CtbSizeY; - int y = ctby << img->sps.Log2CtbSizeY; + int x0 = ctbx << sps.Log2CtbSizeY; + int y = ctby << sps.Log2CtbSizeY; for (int x=x0 ; - (x<x0+(1<<img->sps.Log2CtbSizeY) && - x<img->sps.pic_width_in_luma_samples) ; + (x<x0+(1<<sps.Log2CtbSizeY) && + x<sps.pic_width_in_luma_samples) ; x++) { set_pixel(dst,x,y,stride,color,pixelSize); } @@ -538,18 +540,22 @@ { const uint32_t color = 0xffff00; - for (int tx=1;tx<img->pps.num_tile_columns;tx++) { - int x = img->pps.colBd[tx] << img->sps.Log2CtbSizeY; + const seq_parameter_set& sps = img->get_sps(); + const pic_parameter_set& pps = img->get_pps(); + + + for (int tx=1;tx<pps.num_tile_columns;tx++) { + int x = pps.colBd[tx] << sps.Log2CtbSizeY; - for (int y=0;y<img->sps.pic_height_in_luma_samples;y++) { + for (int y=0;y<sps.pic_height_in_luma_samples;y++) { set_pixel(dst,x,y,stride,color,pixelSize); } } - for (int ty=1;ty<img->pps.num_tile_rows;ty++) { - int y = img->pps.rowBd[ty] << img->sps.Log2CtbSizeY; + for (int ty=1;ty<pps.num_tile_rows;ty++) { + int y = pps.rowBd[ty] << sps.Log2CtbSizeY; - for (int x=0;x<img->sps.pic_width_in_luma_samples;x++) { + for (int x=0;x<sps.pic_width_in_luma_samples;x++) { set_pixel(dst,x,y,stride,color,pixelSize); } }
View file
libde265-1.0.2.tar.gz/libde265/vps.h -> libde265-1.0.3.tar.gz/libde265/vps.h
Changed
@@ -147,7 +147,7 @@ uint8_t vps_max_layer_id; // max value for nuh_layer_id in NALs int vps_num_layer_sets; // [1;1024], currently always 1 - std::vector<std::vector<bool> > layer_id_included_flag; // max size = [1024][64] + std::vector<std::vector<char> > layer_id_included_flag; // max size = [1024][64] // --- timing info ---
View file
libde265-1.0.2.tar.gz/libde265/x86/CMakeLists.txt -> libde265-1.0.3.tar.gz/libde265/x86/CMakeLists.txt
Changed
@@ -6,9 +6,9 @@ sse-motion.cc sse-motion.h sse-dct.h sse-dct.cc ) -add_library(x86 STATIC ${x86_sources}) +add_library(x86 OBJECT ${x86_sources}) -add_library(x86_sse STATIC ${x86_sse_sources}) +add_library(x86_sse OBJECT ${x86_sse_sources}) set(sse_flags "") @@ -16,7 +16,7 @@ set(sse_flags "${sse_flags} -msse4.1") endif() -target_link_libraries(x86 x86_sse) +set(X86_OBJECTS $<TARGET_OBJECTS:x86> $<TARGET_OBJECTS:x86_sse> PARENT_SCOPE) if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") SET_TARGET_PROPERTIES(x86 PROPERTIES COMPILE_FLAGS "-fPIC")
View file
libde265-1.0.2.tar.gz/libde265/x86/Makefile.in -> libde265-1.0.3.tar.gz/libde265/x86/Makefile.in
Changed
@@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -15,7 +15,17 @@ @SET_MAKE@ VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -82,8 +92,6 @@ @HAVE_VISIBILITY_TRUE@am__append_1 = -DHAVE_VISIBILITY @HAVE_VISIBILITY_TRUE@am__append_2 = -DHAVE_VISIBILITY subdir = libde265/x86 -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ @@ -94,6 +102,7 @@ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -197,6 +206,7 @@ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ @@ -249,6 +259,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -331,6 +342,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -371,7 +383,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libde265/x86/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libde265/x86/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -668,6 +679,8 @@ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am +.PRECIOUS: Makefile + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded.
View file
libde265-1.0.2.tar.gz/libde265/x86/sse-motion.cc -> libde265-1.0.3.tar.gz/libde265/x86/sse-motion.cc
Changed
@@ -19,6 +19,10 @@ * along with libde265. If not, see <http://www.gnu.org/licenses/>. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include <stdio.h> #include <emmintrin.h> #include <tmmintrin.h> // SSSE3
View file
libde265-1.0.2.tar.gz/ltmain.sh -> libde265-1.0.3.tar.gz/ltmain.sh
Changed
@@ -1,9 +1,12 @@ +#! /bin/sh +## DO NOT EDIT - This file generated from ./build-aux/ltmain.in +## by inline-source v2014-01-03.01 -# libtool (GNU libtool) 2.4.2 +# libtool (GNU libtool) 2.4.6 +# Provide generalized library-building support services. # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +# Copyright (C) 1996-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -23,881 +26,2112 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, -# or obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see <http://www.gnu.org/licenses/>. -# Usage: $progname [OPTION]... [MODE-ARG]... -# -# Provide generalized library-building support services. -# -# --config show all configuration variables -# --debug enable verbose shell tracing -# -n, --dry-run display commands without modifying any files -# --features display basic configuration information and exit -# --mode=MODE use operation mode MODE -# --preserve-dup-deps don't remove duplicate dependency libraries -# --quiet, --silent don't print informational messages -# --no-quiet, --no-silent -# print informational messages (default) -# --no-warn don't display warning messages -# --tag=TAG use configuration variables from tag TAG -# -v, --verbose print more informational messages than default -# --no-verbose don't print the extra informational messages -# --version print version information -# -h, --help, --help-all print short, long, or detailed help message -# -# MODE must be one of the following: -# -# clean remove files from the build directory -# compile compile a source file into a libtool object -# execute automatically set library path, then run a program -# finish complete the installation of libtool libraries -# install install libraries or executables -# link create a library or an executable -# uninstall remove libraries from an installed directory -# -# MODE-ARGS vary depending on the MODE. When passed as first option, -# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. -# Try `$progname --help --mode=MODE' for a more detailed description of MODE. -# -# When reporting a bug, please describe a test case to reproduce it and -# include the following information: -# -# host-triplet: $host -# shell: $SHELL -# compiler: $LTCC -# compiler flags: $LTCFLAGS -# linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 -# automake: $automake_version -# autoconf: $autoconf_version -# -# Report bugs to <bug-libtool@gnu.org>. -# GNU libtool home page: <http://www.gnu.org/software/libtool/>. -# General help using GNU software: <http://www.gnu.org/gethelp/>. PROGRAM=libtool PACKAGE=libtool -VERSION="2.4.2 Debian-2.4.2-1.7ubuntu1" -TIMESTAMP="" -package_revision=1.3337 +VERSION="2.4.6 Debian-2.4.6-0.1" +package_revision=2.4.6 -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + +## ------ ## +## Usage. ## +## ------ ## + +# Run './libtool --help' for help with using this script from the +# command line. + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# After configure completes, it has a better idea of some of the +# shell tools we need than the defaults used by the functions shared +# with bootstrap, so set those here where they can still be over- +# ridden by the user, but otherwise take precedence. + +: ${AUTOCONF="autoconf"} +: ${AUTOMAKE="automake"} + + +## -------------------------- ## +## Source external libraries. ## +## -------------------------- ## + +# Much of our low-level functionality needs to be sourced from external +# libraries, which are installed to $pkgauxdir. + +# Set a version string for this script. +scriptversion=2015-01-20.17; # UTC + +# General shell script boiler plate, and helper functions. +# Written by Gary V. Vaughan, 2004 + +# Copyright (C) 2004-2015 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# As a special exception to the GNU General Public License, if you distribute +# this file as part of a program or library that is built using GNU Libtool, +# you may include this file under the same distribution terms that you use +# for the rest of that program. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Please report bugs or propose patches to gary@gnu.org. + + +## ------ ## +## Usage. ## +## ------ ## + +# Evaluate this file near the top of your script to gain access to +# the functions and variables defined here: +# +# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh +# +# If you need to override any of the default environment variable +# settings, do that before evaluating this file. + + +## -------------------- ## +## Shell normalisation. ## +## -------------------- ## + +# Some shells need a little help to be as Bourne compatible as possible. +# Before doing anything else, make sure all that help has been provided! + +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac + case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} -# NLS nuisances: We save the old values to restore during execute mode. -lt_user_locale= -lt_safe_locale= -for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +# NLS nuisances: We save the old values in case they are required later. +_G_user_locale= +_G_safe_locale= +for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do - eval "if test \"\${$lt_var+set}\" = set; then
View file
libde265-1.0.2.tar.gz/m4/libtool.m4 -> libde265-1.0.3.tar.gz/m4/libtool.m4
Changed
@@ -1,8 +1,6 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -10,36 +8,30 @@ # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. # -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. # -# GNU Libtool is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see <http://www.gnu.org/licenses/>. ]) -# serial 57 LT_INIT +# serial 58 LT_INIT # LT_PREREQ(VERSION) @@ -67,7 +59,7 @@ # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], -[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl @@ -91,7 +83,7 @@ _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" +LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' @@ -111,26 +103,43 @@ dnl AC_DEFUN([AM_PROG_LIBTOOL], []) +# _LT_PREPARE_CC_BASENAME +# ----------------------- +m4_defun([_LT_PREPARE_CC_BASENAME], [ +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in @S|@*""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} +])# _LT_PREPARE_CC_BASENAME + + # _LT_CC_BASENAME(CC) # ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, +# but that macro is also expanded into generated libtool script, which +# arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +[m4_require([_LT_PREPARE_CC_BASENAME])dnl +AC_REQUIRE([_LT_DECL_SED])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl +func_cc_basename $1 +cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set -# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} @@ -177,15 +186,16 @@ m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl +m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ -# See if we are running on zsh, and set the options which allow our +# See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then +if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) -if test -n "${ZSH_VERSION+set}" ; then +if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi @@ -198,7 +208,7 @@ # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then + if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -209,14 +219,14 @@ ofile=libtool can_build_shared=yes -# All known linkers require a `.a' archive for static linking (except MSVC, +# All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a -with_gnu_ld="$lt_cv_prog_gnu_ld" +with_gnu_ld=$lt_cv_prog_gnu_ld -old_CC="$CC" -old_CFLAGS="$CFLAGS" +old_CC=$CC +old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc @@ -269,14 +279,14 @@ # _LT_PROG_LTMAIN # --------------- -# Note that this code is called both from `configure', and `config.status' +# Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, -# `config.status' has no value for ac_aux_dir unless we are using Automake, +# 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) -ltmain="$ac_aux_dir/ltmain.sh" +ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN
View file
libde265-1.0.2.tar.gz/m4/ltoptions.m4 -> libde265-1.0.3.tar.gz/m4/ltoptions.m4
Changed
@@ -1,14 +1,14 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software +# Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 7 ltoptions.m4 +# serial 8 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) @@ -29,7 +29,7 @@ [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), - [m4_warning([Unknown $1 option `$2'])])[]dnl + [m4_warning([Unknown $1 option '$2'])])[]dnl ]) @@ -75,13 +75,15 @@ dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither - dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], - [_LT_ENABLE_FAST_INSTALL]) + [_LT_ENABLE_FAST_INSTALL]) + _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], + [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS @@ -112,7 +114,7 @@ [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `dlopen' option into LT_INIT's first parameter.]) +put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: @@ -148,7 +150,7 @@ _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `win32-dll' option into LT_INIT's first parameter.]) +put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: @@ -157,9 +159,9 @@ # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- -# implement the --enable-shared flag, and supports the `shared' and -# `disable-shared' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +# implement the --enable-shared flag, and supports the 'shared' and +# 'disable-shared' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], @@ -172,14 +174,14 @@ *) enable_shared=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) @@ -211,9 +213,9 @@ # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- -# implement the --enable-static flag, and support the `static' and -# `disable-static' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +# implement the --enable-static flag, and support the 'static' and +# 'disable-static' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], @@ -226,14 +228,14 @@ *) enable_static=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) @@ -265,9 +267,9 @@ # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- -# implement the --enable-fast-install flag, and support the `fast-install' -# and `disable-fast-install' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +# implement the --enable-fast-install flag, and support the 'fast-install' +# and 'disable-fast-install' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], @@ -280,14 +282,14 @@ *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) @@ -304,14 +306,14 @@ [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `fast-install' option into LT_INIT's first parameter.]) +the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `disable-fast-install' option into LT_INIT's first parameter.]) +the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: @@ -319,11 +321,64 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) +# _LT_WITH_AIX_SONAME([DEFAULT]) +# ---------------------------------- +# implement the --with-aix-soname flag, and support the `aix-soname=aix' +# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT +# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. +m4_define([_LT_WITH_AIX_SONAME], +[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl +shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[[5-9]]*,yes) + AC_MSG_CHECKING([which variant of shared library versioning to provide]) + AC_ARG_WITH([aix-soname], + [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], + [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], + [case $withval in + aix|svr4|both) + ;; + *) + AC_MSG_ERROR([Unknown argument to --with-aix-soname]) + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname], + [AC_CACHE_VAL([lt_cv_with_aix_soname],
View file
libde265-1.0.2.tar.gz/m4/ltsugar.m4 -> libde265-1.0.3.tar.gz/m4/ltsugar.m4
Changed
@@ -1,6 +1,7 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives @@ -33,7 +34,7 @@ # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support -# Autoconf-2.59 which quotes differently. +# Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], @@ -44,7 +45,7 @@ # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ -# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different
View file
libde265-1.0.2.tar.gz/m4/ltversion.m4 -> libde265-1.0.3.tar.gz/m4/ltversion.m4
Changed
@@ -1,6 +1,6 @@ # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004 Free Software Foundation, Inc. +# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives @@ -9,15 +9,15 @@ # @configure_input@ -# serial 3337 ltversion.m4 +# serial 4179 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4.2]) -m4_define([LT_PACKAGE_REVISION], [1.3337]) +m4_define([LT_PACKAGE_VERSION], [2.4.6]) +m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.2' -macro_revision='1.3337' +[macro_version='2.4.6' +macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ])
View file
libde265-1.0.2.tar.gz/m4/lt~obsolete.m4 -> libde265-1.0.3.tar.gz/m4/lt~obsolete.m4
Changed
@@ -1,6 +1,7 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software +# Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives @@ -11,7 +12,7 @@ # These exist entirely to fool aclocal when bootstrapping libtool. # -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # @@ -25,7 +26,7 @@ # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until
View file
libde265-1.0.2.tar.gz/missing -> libde265-1.0.3.tar.gz/missing
Changed
@@ -3,7 +3,7 @@ scriptversion=2013-10-28.13; # UTC -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. # This program is free software; you can redistribute it and/or modify
View file
libde265-1.0.2.tar.gz/sherlock265/Makefile.in -> libde265-1.0.3.tar.gz/sherlock265/Makefile.in
Changed
@@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -15,7 +15,17 @@ @SET_MAKE@ VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -85,8 +95,6 @@ @HAVE_SWSCALE_TRUE@am__append_3 = $(SWSCALE_CFLAGS) @HAVE_SWSCALE_TRUE@am__append_4 = $(SWSCALE_LIBS) subdir = sherlock265 -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/depcomp COPYING README ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ @@ -97,6 +105,7 @@ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -197,6 +206,8 @@ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp COPYING \ + README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ @@ -249,6 +260,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -331,6 +343,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -387,7 +400,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sherlock265/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu sherlock265/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -825,6 +837,8 @@ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS +.PRECIOUS: Makefile + moc_VideoWidget.cpp: VideoWidget.hh $(QTMOC) $(DEFINES) $(INCPATH) VideoWidget.hh -o moc_VideoWidget.cpp
View file
libde265-1.0.2.tar.gz/sherlock265/VideoDecoder.cc -> libde265-1.0.3.tar.gz/sherlock265/VideoDecoder.cc
Changed
@@ -173,19 +173,37 @@ { // --- convert to RGB --- + de265_chroma chroma = de265_get_chroma_format(img); + + int map[3]; + Image<Pixel> visu; - visu.Create(img->get_width(), img->get_height(), Colorspace_YUV, Chroma_420); + if (chroma == de265_chroma_420) { + visu.Create(img->get_width(), img->get_height(), Colorspace_YUV, Chroma_420); + map[0]=0; + map[1]=1; + map[2]=2; + } + else { + visu.Create(img->get_width(), img->get_height(), Colorspace_RGB, Chroma_444); + map[0]=1; + map[1]=2; + map[2]=0; + } for (int y=0;y<img->get_height(0);y++) { - memcpy(visu.AskFrameY()[y], img->get_image_plane_at_pos(0, 0,y), img->get_width(0)); + memcpy(visu.AskFrame(BitmapChannel(map[0]))[y], + img->get_image_plane_at_pos(0, 0,y), img->get_width(0)); } for (int y=0;y<img->get_height(1);y++) { - memcpy(visu.AskFrameU()[y], img->get_image_plane_at_pos(1, 0,y), img->get_width(1)); + memcpy(visu.AskFrame(BitmapChannel(map[1]))[y], + img->get_image_plane_at_pos(1, 0,y), img->get_width(1)); } for (int y=0;y<img->get_height(2);y++) { - memcpy(visu.AskFrameV()[y], img->get_image_plane_at_pos(2, 0,y), img->get_width(2)); + memcpy(visu.AskFrame(BitmapChannel(map[2]))[y], + img->get_image_plane_at_pos(2, 0,y), img->get_width(2)); } Image<Pixel> debugvisu;
View file
libde265-1.0.2.tar.gz/tools/Makefile.am -> libde265-1.0.3.tar.gz/tools/Makefile.am
Changed
@@ -43,4 +43,3 @@ bjoentegaard_LDFLAGS = bjoentegaard_LDADD = ../libde265/libde265.la -lstdc++ bjoentegaard_SOURCES = bjoentegaard.cc -
View file
libde265-1.0.2.tar.gz/tools/Makefile.in -> libde265-1.0.3.tar.gz/tools/Makefile.in
Changed
@@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -15,7 +15,17 @@ @SET_MAKE@ VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -85,8 +95,6 @@ @HAVE_VIDEOGFX_TRUE@am__append_1 = $(VIDEOGFX_CFLAGS) @HAVE_VIDEOGFX_TRUE@am__append_2 = $(VIDEOGFX_LIBS) subdir = tools -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ @@ -97,6 +105,7 @@ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -205,6 +214,7 @@ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ @@ -257,6 +267,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -339,6 +350,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -398,7 +410,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tools/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -819,6 +830,8 @@ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS +.PRECIOUS: Makefile + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded.
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
.