Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
2507b5dd
Commit
2507b5dd
authored
Oct 04, 2015
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpegvideo_enc: export vbv_delay in side data
Deprecate AVCodecContext.vbv_delay
parent
3f5c99fc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
+21
-0
avcodec.h
libavcodec/avcodec.h
+5
-0
mpegvideo_enc.c
libavcodec/mpegvideo_enc.c
+13
-0
version.h
libavcodec/version.h
+3
-0
No files found.
libavcodec/avcodec.h
View file @
2507b5dd
...
...
@@ -2914,13 +2914,18 @@ typedef struct AVCodecContext {
int
error_rate
;
#endif
#if FF_API_VBV_DELAY
/**
* VBV delay coded in the last frame (in periods of a 27 MHz clock).
* Used for compliant TS muxing.
* - encoding: Set by libavcodec.
* - decoding: unused.
* @deprecated this value is now exported as a part of
* AV_PKT_DATA_CPB_PROPERTIES packet side data
*/
attribute_deprecated
uint64_t
vbv_delay
;
#endif
#if FF_API_SIDEDATA_ONLY_PKT
/**
...
...
libavcodec/mpegvideo_enc.c
View file @
2507b5dd
...
...
@@ -1769,6 +1769,9 @@ vbv_retry:
s
->
out_format
==
FMT_MPEG1
&&
90000LL
*
(
avctx
->
rc_buffer_size
-
1
)
<=
s
->
avctx
->
rc_max_rate
*
0xFFFFLL
)
{
AVCPBProperties
*
props
;
size_t
props_size
;
int
vbv_delay
,
min_delay
;
double
inbits
=
s
->
avctx
->
rc_max_rate
*
av_q2d
(
s
->
avctx
->
time_base
);
...
...
@@ -1795,7 +1798,17 @@ vbv_retry:
s
->
vbv_delay_ptr
[
1
]
=
vbv_delay
>>
5
;
s
->
vbv_delay_ptr
[
2
]
&=
0x07
;
s
->
vbv_delay_ptr
[
2
]
|=
vbv_delay
<<
3
;
props
=
av_cpb_properties_alloc
(
&
props_size
);
if
(
!
props
)
return
AVERROR
(
ENOMEM
);
props
->
vbv_delay
=
vbv_delay
*
300
;
#if FF_API_VBV_DELAY
FF_DISABLE_DEPRECATION_WARNINGS
avctx
->
vbv_delay
=
vbv_delay
*
300
;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
}
s
->
total_bits
+=
s
->
frame_bits
;
avctx
->
frame_bits
=
s
->
frame_bits
;
...
...
libavcodec/version.h
View file @
2507b5dd
...
...
@@ -180,5 +180,8 @@
#ifndef FF_API_RTP_CALLBACK
#define FF_API_RTP_CALLBACK (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_VBV_DELAY
#define FF_API_VBV_DELAY (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#endif
/* AVCODEC_VERSION_H */
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