Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
caff8881
Commit
caff8881
authored
Mar 14, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avutil/frame: add AVBufferRef for qp table
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
1edbeb35
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
0 deletions
+45
-0
frame.c
libavutil/frame.c
+38
-0
frame.h
libavutil/frame.h
+7
-0
No files found.
libavutil/frame.c
View file @
caff8881
...
...
@@ -42,6 +42,30 @@ MAKE_ACCESSORS(AVFrame, frame, int, pkt_size)
AVDictionary
**
avpriv_frame_get_metadatap
(
AVFrame
*
frame
)
{
return
&
frame
->
metadata
;};
int
av_frame_set_qp_table
(
AVFrame
*
f
,
AVBufferRef
*
buf
,
int
stride
,
int
qp_type
)
{
av_buffer_unref
(
&
f
->
qp_table_buf
);
f
->
qp_table_buf
=
buf
;
f
->
qscale_table
=
buf
->
data
;
f
->
qstride
=
stride
;
f
->
qscale_type
=
qp_type
;
return
0
;
}
int8_t
*
av_frame_get_qp_table
(
AVFrame
*
f
,
int
*
stride
,
int
*
type
)
{
*
stride
=
f
->
qstride
;
*
type
=
f
->
qscale_type
;
if
(
!
f
->
qp_table_buf
)
return
NULL
;
return
f
->
qp_table_buf
->
data
;
}
static
void
get_frame_defaults
(
AVFrame
*
frame
)
{
if
(
frame
->
extended_data
!=
frame
->
data
)
...
...
@@ -311,6 +335,8 @@ void av_frame_unref(AVFrame *frame)
av_buffer_unref
(
&
frame
->
extended_buf
[
i
]);
av_freep
(
&
frame
->
extended_buf
);
av_dict_free
(
&
frame
->
metadata
);
av_buffer_unref
(
&
frame
->
qp_table_buf
);
get_frame_defaults
(
frame
);
}
...
...
@@ -431,6 +457,18 @@ int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
av_dict_copy
(
&
sd_dst
->
metadata
,
sd_src
->
metadata
,
0
);
}
dst
->
qscale_table
=
NULL
;
dst
->
qstride
=
0
;
dst
->
qscale_type
=
0
;
if
(
src
->
qp_table_buf
)
{
dst
->
qp_table_buf
=
av_buffer_ref
(
src
->
qp_table_buf
);
if
(
dst
->
qp_table_buf
)
{
dst
->
qscale_table
=
dst
->
qp_table_buf
->
data
;
dst
->
qstride
=
src
->
qstride
;
dst
->
qscale_type
=
src
->
qscale_type
;
}
}
return
0
;
}
...
...
libavutil/frame.h
View file @
caff8881
...
...
@@ -419,6 +419,11 @@ typedef struct AVFrame {
* - decoding: set by libavcodec, read by user.
*/
int
pkt_size
;
/**
* Not to be accessed directly from outside libavutil
*/
AVBufferRef
*
qp_table_buf
;
}
AVFrame
;
/**
...
...
@@ -445,6 +450,8 @@ void av_frame_set_decode_error_flags (AVFrame *frame, int val);
int
av_frame_get_pkt_size
(
const
AVFrame
*
frame
);
void
av_frame_set_pkt_size
(
AVFrame
*
frame
,
int
val
);
AVDictionary
**
avpriv_frame_get_metadatap
(
AVFrame
*
frame
);
int8_t
*
av_frame_get_qp_table
(
AVFrame
*
f
,
int
*
stride
,
int
*
type
);
int
av_frame_set_qp_table
(
AVFrame
*
f
,
AVBufferRef
*
buf
,
int
stride
,
int
type
);
/**
* Allocate an AVFrame and set its fields to default values. The resulting
...
...
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