Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
ECM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Monitor
Incidents
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
ECM
ECM
Commits
b6f2a4e9
Commit
b6f2a4e9
authored
1 year ago
by
Fabrice URBAN
Committed by
Vadim Seregin
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Reduce MCTF peak memory allocation by computing applyMotion in place
parent
41ef8a15
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!520
Reduce MCTF peak memory allocation by computing applyMotion in place
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/Lib/EncoderLib/EncTemporalFilter.cpp
+5
-9
5 additions, 9 deletions
source/Lib/EncoderLib/EncTemporalFilter.cpp
with
5 additions
and
9 deletions
source/Lib/EncoderLib/EncTemporalFilter.cpp
+
5
−
9
View file @
b6f2a4e9
...
@@ -207,6 +207,8 @@ bool EncTemporalFilter::filter(PelStorage *orgPic, int receivedPoc)
...
@@ -207,6 +207,8 @@ bool EncTemporalFilter::filter(PelStorage *orgPic, int receivedPoc)
srcPic
.
mvs
.
allocate
(
m_sourceWidth
/
4
,
m_sourceHeight
/
4
);
srcPic
.
mvs
.
allocate
(
m_sourceWidth
/
4
,
m_sourceHeight
/
4
);
motionEstimation
(
srcPic
.
mvs
,
origPadded
,
srcPic
.
picBuffer
,
origSubsampled2
,
origSubsampled4
);
motionEstimation
(
srcPic
.
mvs
,
origPadded
,
srcPic
.
picBuffer
,
origSubsampled2
,
origSubsampled4
);
applyMotion
(
srcPic
.
mvs
,
srcPic
.
picBuffer
,
dummyPicBufferTO
);
srcPic
.
picBuffer
.
swap
(
dummyPicBufferTO
);
srcPic
.
origOffset
=
poc
-
currentFilePoc
;
srcPic
.
origOffset
=
poc
-
currentFilePoc
;
}
}
...
@@ -703,12 +705,6 @@ void EncTemporalFilter::bilateralFilter(const PelStorage &orgPic,
...
@@ -703,12 +705,6 @@ void EncTemporalFilter::bilateralFilter(const PelStorage &orgPic,
double
overallStrength
)
const
double
overallStrength
)
const
{
{
const
int
numRefs
=
int
(
srcFrameInfo
.
size
());
const
int
numRefs
=
int
(
srcFrameInfo
.
size
());
std
::
vector
<
PelStorage
>
correctedPics
(
numRefs
);
for
(
int
i
=
0
;
i
<
numRefs
;
i
++
)
{
correctedPics
[
i
].
create
(
m_chromaFormatIDC
,
m_area
,
0
,
m_padding
);
applyMotion
(
srcFrameInfo
[
i
].
mvs
,
srcFrameInfo
[
i
].
picBuffer
,
correctedPics
[
i
]);
}
const
int
refStrengthRow
=
m_futureRefs
>
0
?
0
:
1
;
const
int
refStrengthRow
=
m_futureRefs
>
0
?
0
:
1
;
...
@@ -751,8 +747,8 @@ void EncTemporalFilter::bilateralFilter(const PelStorage &orgPic,
...
@@ -751,8 +747,8 @@ void EncTemporalFilter::bilateralFilter(const PelStorage &orgPic,
for
(
int
i
=
0
;
i
<
numRefs
;
i
++
)
for
(
int
i
=
0
;
i
<
numRefs
;
i
++
)
{
{
double
variance
=
0
,
diffsum
=
0
;
double
variance
=
0
,
diffsum
=
0
;
const
ptrdiff_t
refStride
=
correctedPics
[
i
]
.
bufs
[
c
].
stride
;
const
ptrdiff_t
refStride
=
srcFrameInfo
[
i
].
picBuffer
.
bufs
[
c
].
stride
;
const
Pel
*
refPel
=
correctedPics
[
i
]
.
bufs
[
c
].
buf
+
y
*
refStride
+
x
;
const
Pel
*
refPel
=
srcFrameInfo
[
i
].
picBuffer
.
bufs
[
c
].
buf
+
y
*
refStride
+
x
;
for
(
int
y1
=
0
;
y1
<
blockSizeY
;
y1
++
)
for
(
int
y1
=
0
;
y1
<
blockSizeY
;
y1
++
)
{
{
for
(
int
x1
=
0
;
x1
<
blockSizeX
;
x1
++
)
for
(
int
x1
=
0
;
x1
<
blockSizeX
;
x1
++
)
...
@@ -795,7 +791,7 @@ void EncTemporalFilter::bilateralFilter(const PelStorage &orgPic,
...
@@ -795,7 +791,7 @@ void EncTemporalFilter::bilateralFilter(const PelStorage &orgPic,
const
int
error
=
srcFrameInfo
[
i
].
mvs
.
get
(
x
/
blockSizeX
,
y
/
blockSizeY
).
error
;
const
int
error
=
srcFrameInfo
[
i
].
mvs
.
get
(
x
/
blockSizeX
,
y
/
blockSizeY
).
error
;
const
int
noise
=
srcFrameInfo
[
i
].
mvs
.
get
(
x
/
blockSizeX
,
y
/
blockSizeY
).
noise
;
const
int
noise
=
srcFrameInfo
[
i
].
mvs
.
get
(
x
/
blockSizeX
,
y
/
blockSizeY
).
noise
;
#endif
#endif
const
Pel
*
pCorrectedPelPtr
=
correctedPics
[
i
].
bufs
[
c
].
buf
+
(
y
*
correctedPics
[
i
]
.
bufs
[
c
].
stride
+
x
);
const
Pel
*
pCorrectedPelPtr
=
srcFrameInfo
[
i
].
picBuffer
.
bufs
[
c
].
buf
+
(
y
*
srcFrameInfo
[
i
].
picBuffer
.
bufs
[
c
].
stride
+
x
);
const
int
refVal
=
(
int
)
*
pCorrectedPelPtr
;
const
int
refVal
=
(
int
)
*
pCorrectedPelPtr
;
double
diff
=
(
double
)(
refVal
-
orgVal
);
double
diff
=
(
double
)(
refVal
-
orgVal
);
diff
*=
bitDepthDiffWeighting
;
diff
*=
bitDepthDiffWeighting
;
...
...
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