Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
TFG-Alberto
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Alberto Gonzalez
TFG-Alberto
Commits
852e499f
Commit
852e499f
authored
Mar 20, 2023
by
Alberto Gonzalez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit 6
-Constructor de copia de Reshape -Constructor de copia de SliceReshapeInfo
parent
acf475c9
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
120 additions
and
13 deletions
+120
-13
source/Lib/CommonLib/Buffer.h
source/Lib/CommonLib/Buffer.h
+11
-5
source/Lib/CommonLib/Reshape.cpp
source/Lib/CommonLib/Reshape.cpp
+23
-0
source/Lib/CommonLib/Reshape.h
source/Lib/CommonLib/Reshape.h
+3
-0
source/Lib/CommonLib/Slice.h
source/Lib/CommonLib/Slice.h
+20
-0
source/Lib/CommonLib/TrQuant.h
source/Lib/CommonLib/TrQuant.h
+15
-0
source/Lib/CommonLib/TypeDef.h
source/Lib/CommonLib/TypeDef.h
+7
-7
source/Lib/DecoderLib/DecCu.h
source/Lib/DecoderLib/DecCu.h
+1
-1
source/Lib/EncoderLib/EncCu.cpp
source/Lib/EncoderLib/EncCu.cpp
+21
-0
source/Lib/EncoderLib/EncCu.h
source/Lib/EncoderLib/EncCu.h
+4
-0
source/Lib/EncoderLib/EncSlice.cpp
source/Lib/EncoderLib/EncSlice.cpp
+11
-0
source/Lib/EncoderLib/EncSlice.h
source/Lib/EncoderLib/EncSlice.h
+4
-0
No files found.
source/Lib/CommonLib/Buffer.h
View file @
852e499f
...
...
@@ -121,11 +121,12 @@ struct AreaBuf : public Size
ptrdiff_t
stride
;
// the proper type causes awful lot of errors
//ptrdiff_t stride;
//ALBERTO
AreaBuf
(
const
AreaBuf
<
const
T
>&
other
)
:
Size
(
other
),
buf
(
other
.
buf
),
stride
(
other
.
stride
)
{}
AreaBuf
(
const
AreaBuf
<
T
>&
other
)
:
Size
(
other
.
width
,
other
.
height
),
stride
(
other
.
stride
),
buf
(
other
.
buf
)
{
//////////////////////buf = new T(*other.buf)
}
//END ALBERTO
AreaBuf
()
:
Size
(),
buf
(
nullptr
),
stride
(
0
)
{}
AreaBuf
(
T
*
_buf
,
const
Size
&
size
)
:
Size
(
size
),
buf
(
_buf
),
stride
(
size
.
width
)
{
}
AreaBuf
(
T
*
_buf
,
const
ptrdiff_t
&
_stride
,
const
Size
&
size
)
:
Size
(
size
),
buf
(
_buf
),
stride
(
_stride
)
{}
...
...
@@ -751,8 +752,13 @@ struct UnitBuf
UnitBufBuffers
bufs
;
//ALBERTO
UnitBuf
(
const
UnitBuf
&
other
)
:
chromaFormat
(
other
.
chromaFormat
),
bufs
(
other
.
bufs
)
{}
UnitBuf
(
const
UnitBuf
&
other
)
:
chromaFormat
(
other
.
chromaFormat
),
bufs
(
other
.
bufs
.
size
())
{
for
(
int
i
=
0
;
i
<
other
.
bufs
.
size
();
++
i
)
{
bufs
[
i
]
=
AreaBuf
<
T
>
(
other
.
bufs
[
i
]);
// Copiamos cada elemento de la original en la nueva instancia
}
}
//END ALBERTO
...
...
source/Lib/CommonLib/Reshape.cpp
View file @
852e499f
...
...
@@ -56,6 +56,29 @@ Reshape::Reshape()
{
}
//ALBERTO
Reshape
::
Reshape
(
const
Reshape
&
other
)
:
m_sliceReshapeInfo
(
other
.
m_sliceReshapeInfo
)
,
m_ctuFlag
(
other
.
m_ctuFlag
)
,
m_recReshaped
(
other
.
m_recReshaped
)
,
m_invLUT
(
other
.
m_invLUT
)
,
m_fwdLUT
(
other
.
m_fwdLUT
)
,
m_chromaAdjHelpLUT
(
other
.
m_chromaAdjHelpLUT
)
,
m_binCW
(
other
.
m_binCW
)
,
m_initCW
(
other
.
m_initCW
)
,
m_reshape
(
other
.
m_reshape
)
,
m_reshapePivot
(
other
.
m_reshapePivot
)
,
m_inputPivot
(
other
.
m_inputPivot
)
,
m_fwdScaleCoef
(
other
.
m_fwdScaleCoef
)
,
m_invScaleCoef
(
other
.
m_invScaleCoef
)
,
m_lumaBD
(
other
.
m_lumaBD
)
,
m_reshapeLUTSize
(
other
.
m_reshapeLUTSize
)
,
m_chromaScale
(
other
.
m_chromaScale
)
,
m_vpduX
(
other
.
m_vpduX
)
,
m_vpduY
(
other
.
m_vpduY
)
{}
// END ALBERTO
Reshape
::~
Reshape
()
{
}
...
...
source/Lib/CommonLib/Reshape.h
View file @
852e499f
...
...
@@ -72,6 +72,9 @@ protected:
int
m_vpduY
;
public:
Reshape
();
//ALBERTO
Reshape
(
const
Reshape
&
other
);
//END ALBERTO
~
Reshape
();
void
createDec
(
int
bitDepth
);
...
...
source/Lib/CommonLib/Slice.h
View file @
852e499f
...
...
@@ -165,6 +165,26 @@ public:
int
reshaperModelBinCWDelta
[
PIC_CODE_CW_BINS
];
int
maxNbitsNeededDeltaCW
;
int
chrResScalingOffset
;
//ALBERTO
SliceReshapeInfo
()
{}
SliceReshapeInfo
(
const
SliceReshapeInfo
&
other
)
:
sliceReshaperEnableFlag
(
other
.
sliceReshaperEnableFlag
)
,
sliceReshaperModelPresentFlag
(
other
.
sliceReshaperModelPresentFlag
)
,
enableChromaAdj
(
other
.
enableChromaAdj
)
,
reshaperModelMinBinIdx
(
other
.
reshaperModelMinBinIdx
)
,
reshaperModelMaxBinIdx
(
other
.
reshaperModelMaxBinIdx
)
,
maxNbitsNeededDeltaCW
(
other
.
maxNbitsNeededDeltaCW
)
,
chrResScalingOffset
(
other
.
chrResScalingOffset
)
{
for
(
size_t
i
=
0
;
i
<
PIC_CODE_CW_BINS
;
++
i
)
{
reshaperModelBinCWDelta
[
i
]
=
other
.
reshaperModelBinCWDelta
[
i
];
}
}
//END ALBERTO
void
setUseSliceReshaper
(
bool
b
)
{
sliceReshaperEnableFlag
=
b
;
}
bool
getUseSliceReshaper
()
const
{
return
sliceReshaperEnableFlag
;
}
void
setSliceReshapeModelPresentFlag
(
bool
b
)
{
sliceReshaperModelPresentFlag
=
b
;
}
...
...
source/Lib/CommonLib/TrQuant.h
View file @
852e499f
...
...
@@ -68,6 +68,21 @@ public:
TrQuant
();
~
TrQuant
();
//ALBERTO
TrQuant
::
TrQuant
(
const
TrQuant
&
other
)
{
m_quant
=
new
DepQuant
(
*
other
.
m_quant
);
std
::
memcpy
(
m_tempCoeff
,
other
.
m_tempCoeff
,
sizeof
(
m_tempCoeff
));
m_mtsCoeffs
=
other
.
m_mtsCoeffs
;
std
::
memcpy
(
m_tempInMatrix
,
other
.
m_tempInMatrix
,
sizeof
(
m_tempInMatrix
));
std
::
memcpy
(
m_tempOutMatrix
,
other
.
m_tempOutMatrix
,
sizeof
(
m_tempOutMatrix
));
std
::
memcpy
(
m_invICTMem
,
other
.
m_invICTMem
,
sizeof
(
m_invICTMem
));
std
::
memcpy
(
m_fwdICTMem
,
other
.
m_fwdICTMem
,
sizeof
(
m_fwdICTMem
));
m_invICT
=
other
.
m_invICT
;
m_fwdICT
=
other
.
m_fwdICT
;
}
//END ALBERTO
// initialize class
void
init
(
const
Quant
*
otherQuant
,
...
...
source/Lib/CommonLib/TypeDef.h
View file @
852e499f
...
...
@@ -1308,13 +1308,13 @@ public:
static
constexpr
size_type
max_num_elements
=
N
;
//ALBERTO
static_vector
(
const
static_vector
<
T
,
N
>&
other
)
:
_size
(
other
.
_size
)
{
for
(
size_t
i
=
0
;
i
<
_size
;
++
i
)
{
_arr
[
i
]
=
T
(
other
.
_arr
[
i
]);
}
}
//
static_vector(const static_vector<T, N>& other) : _size(other._size)
//
{
//
for (size_t i = 0; i < _size; ++i)
//
{
//
_arr[i] = T(other._arr[i]);
//
}
//
}
//END ALBERTO
static_vector
()
:
_size
(
0
)
{
}
static_vector
(
size_t
N_
)
:
_size
(
N_
)
{
}
...
...
source/Lib/DecoderLib/DecCu.h
View file @
852e499f
...
...
@@ -74,7 +74,7 @@ public:
for
(
int
i
=
0
;
i
<
(
MAX_CU_SIZE
*
MAX_CU_SIZE
)
>>
(
MIN_CU_LOG2
<<
1
);
i
++
)
{
m_SubPuMiBuf
[
i
]
=
other
.
m_SubPuMiBuf
[
i
]
;
m_SubPuMiBuf
[
i
]
=
MotionInfo
(
other
.
m_SubPuMiBuf
[
i
])
;
}
}
//END ALBERTO
...
...
source/Lib/EncoderLib/EncCu.cpp
View file @
852e499f
...
...
@@ -53,6 +53,10 @@
#include <cmath>
#include <algorithm>
//ALBERTO
#include <chrono>
//END ALBERTO
//! \ingroup EncoderLib
//! \{
...
...
@@ -614,6 +618,11 @@ bool EncCu::xCheckBestMode( CodingStructure *&tempCS, CodingStructure *&bestCS,
void
EncCu
::
xCompressCU
(
CodingStructure
*&
tempCS
,
CodingStructure
*&
bestCS
,
Partitioner
&
partitioner
,
double
maxCostAllowed
)
{
//ALBERTO
iter
+=
1
;
int
iterLocal
=
iter
;
auto
start
=
std
::
chrono
::
high_resolution_clock
::
now
();
//END ALBERTO
CHECK
(
maxCostAllowed
<
0
,
"Wrong value of maxCostAllowed!"
);
uint32_t
compBegin
;
...
...
@@ -1174,6 +1183,18 @@ void EncCu::xCompressCU( CodingStructure*& tempCS, CodingStructure*& bestCS, Par
CHECK
(
bestCS
->
cus
.
empty
()
,
"No possible encoding found"
);
CHECK
(
bestCS
->
cus
[
0
]
->
predMode
==
NUMBER_OF_PREDICTION_MODES
,
"No possible encoding found"
);
CHECK
(
bestCS
->
cost
==
MAX_DOUBLE
,
"No possible encoding found"
);
//ALBERTO
if
(
iterLocal
==
1
)
{
auto
end
=
std
::
chrono
::
high_resolution_clock
::
now
();
auto
duration
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
milliseconds
>
(
end
-
start
);
auto
before
=
seconds
;
seconds
+=
static_cast
<
int
>
(
duration
.
count
()
/
1000
);
std
::
cout
<<
"La iter "
<<
iter
<<
" de la func tarda "
<<
static_cast
<
int
>
(
duration
.
count
()
/
1000
)
<<
" + "
<<
before
<<
" = "
<<
seconds
<<
" segundos en ejecutarse."
<<
std
::
endl
;
iter
=
0
;
}
//END ALBERTO
}
#if SHARP_LUMA_DELTA_QP || ENABLE_QPA_SUB_CTU
...
...
source/Lib/EncoderLib/EncCu.h
View file @
852e499f
...
...
@@ -226,6 +226,10 @@ class EncCu
:
DecCu
{
private:
//ALBERTO
static
int
iter
;
static
int
seconds
;
//END ALBERTO
bool
m_bestModeUpdated
;
struct
CtxPair
{
...
...
source/Lib/EncoderLib/EncSlice.cpp
View file @
852e499f
...
...
@@ -54,6 +54,11 @@
// Constructor / destructor / create / destroy
// ====================================================================================================================
//ALBERTO
int
EncCu
::
seconds
=
0
;
int
EncCu
::
iter
=
0
;
//END ALBERTO
EncSlice
::
EncSlice
()
:
m_encCABACTableIdx
(
I_SLICE
)
#if ENABLE_QPA
...
...
@@ -84,6 +89,9 @@ void EncSlice::init( EncLib* pcEncLib, const SPS& sps )
{
m_pcCfg
=
pcEncLib
;
m_pcLib
=
pcEncLib
;
//ALBERTO
m_pcSps
=
sps
;
//END ALBERTO
m_pcListPic
=
pcEncLib
->
getListPic
();
m_pcGOPEncoder
=
pcEncLib
->
getGOPEncoder
();
...
...
@@ -1896,6 +1904,9 @@ void EncSlice::encodeCtus( Picture* pcPic, const bool bCompressEntireSlice, cons
//ALBERTO
EncCu
*
m_pcCuEncoder_COPY_BEFORE
=
new
EncCu
(
*
m_pcCuEncoder
);
bool
stop_debugger_1
=
true
;
//EncCu new_m_pcCuEncoder;
//new_m_pcCuEncoder.create(m_pcCfg);
//new_m_pcCuEncoder.init(m_pcLib, m_pcSps);
//END ALBERTO
m_pcCuEncoder
->
compressCtu
(
cs
,
ctuArea
,
ctuRsAddr
,
prevQP
,
currQP
);
//ALBERTO
...
...
source/Lib/EncoderLib/EncSlice.h
View file @
852e499f
...
...
@@ -66,6 +66,10 @@ private:
EncLib
*
m_pcLib
;
//ALBERTO
SPS
m_pcSps
;
//END ALBERTO
// pictures
PicList
*
m_pcListPic
;
///< list of pictures
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment