Skip to content

Commit

Permalink
v1.4.0-rc1: Clear BSD, fixes and improvements! (#146)
Browse files Browse the repository at this point in the history
* Preparing v1.4.0-rc1

* fixed line endings in the new copyright license
  • Loading branch information
adamjw24 authored Mar 14, 2022
1 parent c496ae4 commit aa67726
Show file tree
Hide file tree
Showing 262 changed files with 8,135 additions and 8,801 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ if( NOT CMAKE_VERSION VERSION_LESS 3.13.0 )
endif()

# project name
project( vvenc VERSION 1.3.1 )
project( vvenc VERSION 1.4.0 )

# set alternative version numbering for release candidates
#set(PROJECT_VERSION_RC rc1)
if(PROJECT_VERSION_RC)
set(PROJECT_VERSION "${PROJECT_VERSION}-rc${PROJECT_VERSION_RC}")
set( PROJECT_VERSION_RC rc1 )
if( PROJECT_VERSION_RC )
set( PROJECT_VERSION "${PROJECT_VERSION}-rc${PROJECT_VERSION_RC}" )
endif()

set( VVENC_ENABLE_X86_SIMD TRUE )
Expand Down
62 changes: 29 additions & 33 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,45 +1,41 @@
/* -----------------------------------------------------------------------------
The copyright in this software is being made available under the BSD
The copyright in this software is being made available under the Clear BSD
License, included below. No patent rights, trademark rights and/or
other Intellectual Property Rights other than the copyrights concerning
the Software are granted under this license.

For any license concerning other Intellectual Property rights than the software,
especially patent licenses, a separate Agreement needs to be closed.
For more information please contact:
The Clear BSD License

Fraunhofer Heinrich Hertz Institute
Einsteinufer 37
10587 Berlin, Germany
www.hhi.fraunhofer.de/vvc
vvc@hhi.fraunhofer.de

Copyright (c) 2019-2022, Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
Copyright (c) 2019-2022, Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. & The VVenC Authors.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistribution and use in source and binary forms, with or without modification,
are permitted (subject to the limitations in the disclaimer below) provided that
the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of Fraunhofer nor the names of its contributors may
be used to endorse or promote products derived from this software without
specific prior written permission.
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.

NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY
THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.


------------------------------------------------------------------------------------------- */
Expand All @@ -50,7 +46,7 @@ notices of its source files. The VVC Test Model (VTM) reference software is lice
the following 3-Clause BSD License:

/* -----------------------------------------------------------------------------
The copyright in this software is being made available under the BSD
The copyright in this software is being made available under the Clear BSD
License, included below. This software may be subject to other third party
and contributor rights, including patent rights, and no such rights are
granted under this license.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ Please see [LICENSE.txt](./LICENSE.txt) file for the terms of use of the content

For more information, please contact: vvc@hhi.fraunhofer.de

**Copyright (c) 2019-2022 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.**
**Copyright (c) 2019-2022, Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. & The VVenC Authors.**

**All rights reserved.**
1 change: 1 addition & 0 deletions cfg/experimental/lowdelay_fast.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Profile : auto
IntraPeriod : -1 # Period of I-Frame ( -1 = only first)
DecodingRefreshType : 0 # Random Accesss 0:none, 1:CRA, 2:IDR, 3:Recovery Point SEI
GOPSize : 8 # GOP Size (number of B slice = GOPSize-1)
STA : 0

IntraQPOffset : -1
LambdaFromQpEnable : 1 # see JCTVC-X0038 for suitable parameters for IntraQPOffset, QPoffset, QPOffsetModelOff, QPOffsetModelScale when enabled
Expand Down
1 change: 1 addition & 0 deletions cfg/experimental/lowdelay_faster.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Profile : auto
IntraPeriod : -1 # Period of I-Frame ( -1 = only first)
DecodingRefreshType : 0 # Random Accesss 0:none, 1:CRA, 2:IDR, 3:Recovery Point SEI
GOPSize : 8 # GOP Size (number of B slice = GOPSize-1)
STA : 0

IntraQPOffset : -1
LambdaFromQpEnable : 1 # see JCTVC-X0038 for suitable parameters for IntraQPOffset, QPoffset, QPOffsetModelOff, QPOffsetModelScale when enabled
Expand Down
1 change: 1 addition & 0 deletions cfg/experimental/lowdelay_medium.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Profile : auto
IntraPeriod : -1 # Period of I-Frame ( -1 = only first)
DecodingRefreshType : 0 # Random Accesss 0:none, 1:CRA, 2:IDR, 3:Recovery Point SEI
GOPSize : 8 # GOP Size (number of B slice = GOPSize-1)
STA : 0

IntraQPOffset : -1
LambdaFromQpEnable : 1 # see JCTVC-X0038 for suitable parameters for IntraQPOffset, QPoffset, QPOffsetModelOff, QPOffsetModelScale when enabled
Expand Down
1 change: 1 addition & 0 deletions cfg/experimental/lowdelay_slow.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Profile : auto
IntraPeriod : -1 # Period of I-Frame ( -1 = only first)
DecodingRefreshType : 0 # Random Accesss 0:none, 1:CRA, 2:IDR, 3:Recovery Point SEI
GOPSize : 8 # GOP Size (number of B slice = GOPSize-1)
STA : 0

IntraQPOffset : -1
LambdaFromQpEnable : 1 # see JCTVC-X0038 for suitable parameters for IntraQPOffset, QPoffset, QPOffsetModelOff, QPOffsetModelScale when enabled
Expand Down
1 change: 1 addition & 0 deletions cfg/experimental/lowdelay_slower.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Profile : auto
IntraPeriod : -1 # Period of I-Frame ( -1 = only first)
DecodingRefreshType : 0 # Random Accesss 0:none, 1:CRA, 2:IDR, 3:Recovery Point SEI
GOPSize : 8 # GOP Size (number of B slice = GOPSize-1)
STA : 0

IntraQPOffset : -1
LambdaFromQpEnable : 1 # see JCTVC-X0038 for suitable parameters for IntraQPOffset, QPoffset, QPOffsetModelOff, QPOffsetModelScale when enabled
Expand Down
38 changes: 38 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
/////////////////////////////////////////
tag 1.4.0 (rc1)

* all:
- changed license to the standard Clear BSD license (without adaptations)
- explicitly stating the authors (AUTHORS.md) as copyright holders

* libvvenc:
- removed library parameters:
- vvencMCTF::MCTFNumLeadFrames, vvencMCTF::MCTFNumTrailFrames
- vvenc_config::m_RCLookAhead (now always behaving as if equal to 1)
- added library parameters:
- vvenc_config::m_leadFrames, vvenc_config::m_trailFrames, vvenc_config::m_LookAhead, vvenc_config::m_sliceTypeAdapt
- add function to extract SPS, PPS and other headers during encoding
int vvenc_get_headers(vvencEncoder *, vvencAccessUnit *);
- removed legacy 1-pass rate control (now always using the look-ahead based 1pRC)
- added a slice adaptation mode inserting intra-frames instead of TL-0 B-frames when scene-cut is detected within the preceding GOP
- fix encoder initialization with other bitstream when using rate control
- fixed CU tracing
- ported improvements to motion compensated filtering from JVET
- fixed LMCS processing for 8-bit internal bitdepth coding
- various fixes and improvements

* vvencapp:
- changed semantics of the bitrate parameters to understand suffixes (Mbps, M, kbps, k, bps),
associated with multipliers (1e6, 1e6, 1e3, 1e3, 1), respectively
- added y4m parameter to force input interpretation as Y4M (also inferred when file file extension is .y4m)

* vvencFFapp:
- added command line parameters:
- STA: enable/disable TL-0 B-to-I slice type adaptation after scene cuts (default: on)
- renamed parameters:
- MCTFNumLeadFrames -> LeadFrames (now also relevant in chunk based encoding for STA)
- MCTFNumTrailFrames -> TrailFrames
- changed semantics of the TargetBitrate parameter to understand suffixes (Mbps, M, kbps, k, bps),
associated with multipliers (1e6, 1e6, 1e3, 1e3, 1), respectively
- added y4m parameter to force input interpretation as Y4M (also inferred when file file extension is .y4m)

/////////////////////////////////////////
tag 1.3.1

Expand Down
161 changes: 124 additions & 37 deletions include/apputils/IStreamIO.h
Original file line number Diff line number Diff line change
@@ -1,45 +1,41 @@
/* -----------------------------------------------------------------------------
The copyright in this software is being made available under the BSD
License, included below. No patent rights, trademark rights and/or
other Intellectual Property Rights other than the copyrights concerning
The copyright in this software is being made available under the Clear BSD
License, included below. No patent rights, trademark rights and/or
other Intellectual Property Rights other than the copyrights concerning
the Software are granted under this license.
For any license concerning other Intellectual Property rights than the software,
especially patent licenses, a separate Agreement needs to be closed.
For more information please contact:
The Clear BSD License
Fraunhofer Heinrich Hertz Institute
Einsteinufer 37
10587 Berlin, Germany
www.hhi.fraunhofer.de/vvc
vvc@hhi.fraunhofer.de
Copyright (c) 2019-2022, Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
Copyright (c) 2019-2022, Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. & The VVenC Authors.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of Fraunhofer nor the names of its contributors may
be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
Redistribution and use in source and binary forms, with or without modification,
are permitted (subject to the limitations in the disclaimer below) provided that
the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY
THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------------------- */
Expand All @@ -52,6 +48,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
#include <list>
#include <map>
#include <vector>
#include <algorithm>

#include "apputils/VVEncAppCfg.h"
#include <vvenc/vvencCfg.h>
Expand All @@ -68,6 +65,10 @@ struct APPUTILS_DECL SVPair
E value;
};

// ====================================================================================================================
// string <-> vector
// ====================================================================================================================

template<typename T>
class APPUTILS_DECL IStreamToRefVec
{
Expand Down Expand Up @@ -163,6 +164,11 @@ inline std::ostream& operator << ( std::ostream& os, const IStreamToRefVec<T>& t
return os;
}


// ====================================================================================================================
// string <-> enum
// ====================================================================================================================

template<typename E>
class APPUTILS_DECL IStreamToEnum
{
Expand Down Expand Up @@ -239,7 +245,7 @@ inline std::ostream& operator << ( std::ostream& os, const IStreamToEnum<E>& toE
}

// ====================================================================================================================
// string <-> enum
// string <-> function
// ====================================================================================================================


Expand Down Expand Up @@ -598,6 +604,87 @@ inline std::ostream& operator << ( std::ostream& os, const IStreamToArr<char>& t
return os;
}


// ====================================================================================================================
// string -> abbreviated value
// ====================================================================================================================

// T: value type, A abbreviation value type
template<typename T, typename A>
class APPUTILS_DECL IStreamToAbbr
{
public:
IStreamToAbbr( T* v, const std::vector<SVPair<A>>* m )
: dstVal ( v )
, toMap ( m )
{
}

~IStreamToAbbr()
{
}

template<typename F, typename G>
friend std::istream& operator >> ( std::istream& in, IStreamToAbbr<F,G>& toValue );

template<typename F, typename G>
friend std::ostream& operator << ( std::ostream& in, const IStreamToAbbr<F,G>& toValue );

private:
T* dstVal;
const std::vector<SVPair<A>>* toMap;
};

template<typename T, typename A>
inline std::istream& operator >> ( std::istream& in, IStreamToAbbr<T,A>& toValue )
{
std::string str;
in >> str;

// search map for a used abbreviation
for ( const auto& map : *toValue.toMap )
{
std::string key(map.str);
std::size_t n = str.find( key );
if (n!=std::string::npos)
{
str.erase(n, key.length()); // remove the scaling unit, e.g. 1.5M -> 1.5
replace_if( str.begin(), str.end(), []( int c ){ return c == ','; }, '.' ); // use correct comma syntax for double representaion

bool isNumber = strspn( str.c_str(), "-.0123456789" ) == str.size(); // check if valid double value
if( !isNumber)
{
in.setstate( std::ios::failbit );
return in;
}

double value = strtod(str.c_str(), NULL); // convert input string to double
value *= map.value; // scale depending on given abbreviation/scaling factor
*toValue.dstVal = (T)value;
return in;
}
}

// read value in original format
std::string::size_type posAfter;
*toValue.dstVal = std::stoi( str, &posAfter );

if( posAfter && !str.substr(posAfter).empty() ) // check if value is valid int
{
in.setstate( std::ios::failbit );
}

return in;
}

template<typename T, typename A>
inline std::ostream& operator << ( std::ostream& os, const IStreamToAbbr<T,A>& toValue )
{
os << *toValue.dstVal;
return os;
}


// ====================================================================================================================
// vvencGOPEntry
// ====================================================================================================================
Expand Down
Loading

0 comments on commit aa67726

Please sign in to comment.