Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VVCSoftware_VTM
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Keming Cao
VVCSoftware_VTM
Commits
7bb3a8ae
Commit
7bb3a8ae
authored
4 years ago
by
Frank Bossen
Browse files
Options
Downloads
Patches
Plain Diff
Write MD5 and size of cropped picture into output log file
parent
0fc71163
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
source/App/DecoderApp/DecApp.cpp
+16
-6
16 additions, 6 deletions
source/App/DecoderApp/DecApp.cpp
source/Lib/CommonLib/PicYuvMD5.cpp
+19
-4
19 additions, 4 deletions
source/Lib/CommonLib/PicYuvMD5.cpp
source/Lib/CommonLib/Picture.h
+3
-0
3 additions, 0 deletions
source/Lib/CommonLib/Picture.h
with
38 additions
and
10 deletions
source/App/DecoderApp/DecApp.cpp
+
16
−
6
View file @
7bb3a8ae
...
...
@@ -337,12 +337,22 @@ void DecApp::writeLineToOutputLog(Picture * pcPic)
{
if
(
m_oplFileStream
.
is_open
()
&&
m_oplFileStream
.
good
())
{
const
SPS
*
sps
=
pcPic
->
cs
->
sps
;
PictureHash
recon_digest
;
auto
numChar
=
calcMD5
(((
const
Picture
*
)
pcPic
)
->
getRecoBuf
(),
recon_digest
,
sps
->
getBitDepths
());
m_oplFileStream
<<
std
::
setw
(
8
)
<<
pcPic
->
getPOC
()
<<
","
<<
std
::
setw
(
5
)
<<
pcPic
->
Y
().
width
<<
","
<<
std
::
setw
(
5
)
<<
pcPic
->
Y
().
height
<<
","
<<
hashToString
(
recon_digest
,
numChar
)
<<
"
\n
"
;
const
SPS
*
sps
=
pcPic
->
cs
->
sps
;
ChromaFormat
chromaFormatIDC
=
sps
->
getChromaFormatIdc
();
const
Window
&
conf
=
pcPic
->
getConformanceWindow
();
const
int
leftOffset
=
conf
.
getWindowLeftOffset
()
*
SPS
::
getWinUnitX
(
chromaFormatIDC
);
const
int
rightOffset
=
conf
.
getWindowRightOffset
()
*
SPS
::
getWinUnitX
(
chromaFormatIDC
);
const
int
topOffset
=
conf
.
getWindowTopOffset
()
*
SPS
::
getWinUnitY
(
chromaFormatIDC
);
const
int
bottomOffset
=
conf
.
getWindowBottomOffset
()
*
SPS
::
getWinUnitY
(
chromaFormatIDC
);
PictureHash
recon_digest
;
auto
numChar
=
calcMD5WithCropping
(((
const
Picture
*
)
pcPic
)
->
getRecoBuf
(),
recon_digest
,
sps
->
getBitDepths
(),
leftOffset
,
rightOffset
,
topOffset
,
bottomOffset
);
const
int
croppedWidth
=
pcPic
->
Y
().
width
-
leftOffset
-
rightOffset
;
const
int
croppedHeight
=
pcPic
->
Y
().
height
-
topOffset
-
bottomOffset
;
m_oplFileStream
<<
std
::
setw
(
8
)
<<
pcPic
->
getPOC
()
<<
","
<<
std
::
setw
(
5
)
<<
croppedWidth
<<
","
<<
std
::
setw
(
5
)
<<
croppedHeight
<<
","
<<
hashToString
(
recon_digest
,
numChar
)
<<
"
\n
"
;
}
}
...
...
This diff is collapsed.
Click to expand it.
source/Lib/CommonLib/PicYuvMD5.cpp
+
19
−
4
View file @
7bb3a8ae
...
...
@@ -186,6 +186,12 @@ uint32_t calcChecksum(const CPelUnitBuf& pic, PictureHash &digest, const BitDept
* uses little-endian two byte words; 8bit data uses single byte words.
*/
uint32_t
calcMD5
(
const
CPelUnitBuf
&
pic
,
PictureHash
&
digest
,
const
BitDepths
&
bitDepths
)
{
return
calcMD5WithCropping
(
pic
,
digest
,
bitDepths
,
0
,
0
,
0
,
0
);
}
uint32_t
calcMD5WithCropping
(
const
CPelUnitBuf
&
pic
,
PictureHash
&
digest
,
const
BitDepths
&
bitDepths
,
const
int
leftOffset
,
const
int
rightOffset
,
const
int
topOffset
,
const
int
bottomOffset
)
{
/* choose an md5_plane packing function based on the system bitdepth */
typedef
void
(
*
MD5PlaneFunc
)(
MD5
&
,
const
Pel
*
,
uint32_t
,
uint32_t
,
uint32_t
);
...
...
@@ -197,17 +203,26 @@ uint32_t calcMD5(const CPelUnitBuf& pic, PictureHash &digest, const BitDepths &b
for
(
uint32_t
chan
=
0
;
chan
<
(
uint32_t
)
pic
.
bufs
.
size
();
chan
++
)
{
const
ComponentID
compID
=
ComponentID
(
chan
);
const
CPelBuf
area
=
pic
.
get
(
compID
);
const
ComponentID
compID
=
ComponentID
(
chan
);
const
CPelBuf
area
=
pic
.
get
(
compID
);
const
int
chromaScaleX
=
getComponentScaleX
(
compID
,
pic
.
chromaFormat
);
const
int
chromaScaleY
=
getComponentScaleY
(
compID
,
pic
.
chromaFormat
);
const
int
compLeftOffset
=
leftOffset
>>
chromaScaleX
;
const
int
compRightOffset
=
rightOffset
>>
chromaScaleX
;
const
int
compTopOffset
=
topOffset
>>
chromaScaleY
;
const
int
compBottomOffset
=
bottomOffset
>>
chromaScaleY
;
md5_plane_func
=
bitDepths
.
recon
[
toChannelType
(
compID
)]
<=
8
?
(
MD5PlaneFunc
)
md5_plane
<
1
>
:
(
MD5PlaneFunc
)
md5_plane
<
2
>
;
uint8_t
tmp_digest
[
MD5_DIGEST_STRING_LENGTH
];
md5_plane_func
(
md5
[
compID
],
area
.
bufAt
(
0
,
0
),
area
.
width
,
area
.
height
,
area
.
stride
);
md5_plane_func
(
md5
[
compID
],
area
.
bufAt
(
compLeftOffset
,
compTopOffset
),
area
.
width
-
compRightOffset
-
compLeftOffset
,
area
.
height
-
compTopOffset
-
compBottomOffset
,
area
.
stride
);
md5
[
compID
].
finalize
(
tmp_digest
);
for
(
uint32_t
i
=
0
;
i
<
MD5_DIGEST_STRING_LENGTH
;
i
++
)
for
(
uint32_t
i
=
0
;
i
<
MD5_DIGEST_STRING_LENGTH
;
i
++
)
{
digest
.
hash
.
push_back
(
tmp_digest
[
i
]);
}
}
return
16
;
}
...
...
This diff is collapsed.
Click to expand it.
source/Lib/CommonLib/Picture.h
+
3
−
0
View file @
7bb3a8ae
...
...
@@ -353,6 +353,9 @@ public:
int
calcAndPrintHashStatus
(
const
CPelUnitBuf
&
pic
,
const
class
SEIDecodedPictureHash
*
pictureHashSEI
,
const
BitDepths
&
bitDepths
,
const
MsgLevel
msgl
);
uint32_t
calcMD5
(
const
CPelUnitBuf
&
pic
,
PictureHash
&
digest
,
const
BitDepths
&
bitDepths
);
uint32_t
calcMD5WithCropping
(
const
CPelUnitBuf
&
pic
,
PictureHash
&
digest
,
const
BitDepths
&
bitDepths
,
const
int
leftOffset
,
const
int
rightOffset
,
const
int
topOffset
,
const
int
bottomOffset
);
std
::
string
hashToString
(
const
PictureHash
&
digest
,
int
numChar
);
typedef
std
::
list
<
Picture
*>
PicList
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment