Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gstlal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Duncan Macleod
gstlal
Commits
9292fd38
Commit
9292fd38
authored
6 years ago
by
Aaron Viets
Browse files
Options
Downloads
Patches
Plain Diff
lal_smoothkappas: Fixed buffer sizing bug.
parent
5a842452
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gstlal-calibration/gst/lal/gstlal_smoothkappas.c
+16
-24
16 additions, 24 deletions
gstlal-calibration/gst/lal/gstlal_smoothkappas.c
gstlal-calibration/python/calibration_parts.py
+1
-0
1 addition, 0 deletions
gstlal-calibration/python/calibration_parts.py
with
17 additions
and
24 deletions
gstlal-calibration/gst/lal/gstlal_smoothkappas.c
+
16
−
24
View file @
9292fd38
...
...
@@ -477,24 +477,25 @@ static gboolean transform_size(GstBaseTransform *trans, GstPadDirection directio
GSTLALSmoothKappas
*
element
=
GSTLAL_SMOOTHKAPPAS
(
trans
);
gsize
unit_size
;
if
(
!
get_unit_size
(
trans
,
caps
,
&
unit_size
))
{
GST_DEBUG_OBJECT
(
element
,
"function 'get_unit_size' failed"
);
return
FALSE
;
}
/* buffer size in bytes should be a multiple of unit_size in bytes */
if
(
G_UNLIKELY
(
size
%
unit_size
))
{
GST_DEBUG_OBJECT
(
element
,
"buffer size %"
G_GSIZE_FORMAT
" is not a multiple of %"
G_GSIZE_FORMAT
,
size
,
unit_size
);
return
FALSE
;
}
size
/=
unit_size
;
/* How many samples do we need to throw away based on the filter latency? */
int
waste_samples
=
(
int
)
(
element
->
filter_latency
*
(
element
->
array_size
+
element
->
avg_array_size
-
2
));
switch
(
direction
)
{
case
GST_PAD_SRC
:
/*We have the size of the output buffer, and we set the size of the input buffer. */
if
(
!
get_unit_size
(
trans
,
caps
,
&
unit_size
))
{
GST_DEBUG_OBJECT
(
element
,
"function 'get_unit_size' failed"
);
return
FALSE
;
}
/* buffer size in bytes should be a multiple of unit_size in bytes */
if
(
G_UNLIKELY
(
size
%
unit_size
))
{
GST_DEBUG_OBJECT
(
element
,
"buffer size %"
G_GSIZE_FORMAT
" is not a multiple of %"
G_GSIZE_FORMAT
,
size
,
unit_size
);
return
FALSE
;
}
/* We have the size of the output buffer, and we set the size of the input buffer. */
/* Check if we need to clip the output buffer */
if
(
element
->
samples_in_filter
>=
waste_samples
)
*
othersize
=
size
;
...
...
@@ -505,21 +506,10 @@ static gboolean transform_size(GstBaseTransform *trans, GstPadDirection directio
case
GST_PAD_SINK
:
/* We have the size of the input buffer, and we set the size of the output buffer. */
if
(
!
get_unit_size
(
trans
,
caps
,
&
unit_size
))
{
GST_DEBUG_OBJECT
(
element
,
"function 'get_unit_size' failed"
);
return
FALSE
;
}
/* buffer size in bytes should be a multiple of unit_size in bytes */
if
(
G_UNLIKELY
(
size
%
unit_size
))
{
GST_DEBUG_OBJECT
(
element
,
"buffer size %"
G_GSIZE_FORMAT
" is not a multiple of %"
G_GSIZE_FORMAT
,
size
,
unit_size
);
return
FALSE
;
}
/* Check if we need to clip the output buffer */
if
(
element
->
samples_in_filter
>=
waste_samples
)
*
othersize
=
size
;
else
if
(
size
>
(
guint
)
(
waste_samples
+
element
->
samples_in_filter
))
else
if
(
size
>
(
guint
)
(
waste_samples
-
element
->
samples_in_filter
))
*
othersize
=
size
-
waste_samples
+
element
->
samples_in_filter
;
else
*
othersize
=
0
;
...
...
@@ -531,6 +521,8 @@ static gboolean transform_size(GstBaseTransform *trans, GstPadDirection directio
return
FALSE
;
}
*
othersize
*=
unit_size
;
return
TRUE
;
}
...
...
This diff is collapsed.
Click to expand it.
gstlal-calibration/python/calibration_parts.py
+
1
−
0
View file @
9292fd38
...
...
@@ -201,6 +201,7 @@ def remove_harmonics_with_witness(pipeline, signal, witness, f0, num_harmonics,
upsample_quality
=
4
resample_shift
=
16.0
+
16.5
zero_latency
=
filter_latency
==
0.0
filter_latency
=
min
(
0.5
,
filter_latency
)
witness
=
pipeparts
.
mktee
(
pipeline
,
witness
)
signal
=
pipeparts
.
mktee
(
pipeline
,
signal
)
...
...
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