-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev v4l2 stateless #83
Open
semigle
wants to merge
7
commits into
chromeos:main
Choose a base branch
from
semigle:dev-v4l2_stateless
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8d99b44
codec/h264: Add missing V4l2 fields to SliceHeader
semigle 7ca7c7d
device/v4l2: Add v4l2 stateless device abstraction
semigle 52f81bd
backend/v4l2: Add v4l2 stateless decoder backend
semigle 2a66965
decoder/h264: Add support for v4l2 backend
semigle 07dfccd
examples/ccdec: Add example for v4l2 backend
semigle 1af2ce1
decoder/stateless/v4l2/h264: remove unneeded `V4l2CtrlH264Sps` and `V…
Gnurou f51face
decoder/stateless/v4l2: remove RefCell from V4l2Request
Gnurou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -266,6 +266,10 @@ pub struct SliceHeader { | |
/// the bottom field of a coded frame specified in clause 8.2.1. | ||
pub delta_pic_order_cnt: [i32; 2], | ||
|
||
/// This value is required by V4L2 stateless decode params so it is calculated | ||
/// by parser while processing slice header. | ||
pub pic_order_cnt_bit_size: usize, | ||
|
||
/// Shall be equal to 0 for slices and slice data partitions belonging to | ||
/// the primary coded picture. The value of `redundant_pic_cnt shall` be | ||
/// greater than 0 for coded slices or coded slice data partitions of a | ||
|
@@ -315,6 +319,10 @@ pub struct SliceHeader { | |
/// Decoded reference picture marking parsed using 7.3.3.3 | ||
pub dec_ref_pic_marking: RefPicMarking, | ||
|
||
/// This value is required by V4L2 stateless decode params so it is calculated | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
/// by parser while processing slice header. | ||
pub dec_ref_pic_marking_bit_size: usize, | ||
|
||
/// Specifies the index for determining the initialization table used in the | ||
/// initialization process for context variables. | ||
pub cabac_init_idc: u8, | ||
|
@@ -2334,6 +2342,7 @@ impl Parser { | |
) -> anyhow::Result<()> { | ||
let rpm = &mut header.dec_ref_pic_marking; | ||
|
||
let num_bits_left = r.num_bits_left(); | ||
if nalu.header.idr_pic_flag { | ||
rpm.no_output_of_prior_pics_flag = r.read_bit()?; | ||
rpm.long_term_reference_flag = r.read_bit()?; | ||
|
@@ -2372,6 +2381,7 @@ impl Parser { | |
} | ||
} | ||
} | ||
header.dec_ref_pic_marking_bit_size = num_bits_left - r.num_bits_left(); | ||
|
||
Ok(()) | ||
} | ||
|
@@ -2436,6 +2446,7 @@ impl Parser { | |
header.idr_pic_id = r.read_ue_max(0xffff)?; | ||
} | ||
|
||
let num_bits_left = r.num_bits_left(); | ||
if sps.pic_order_cnt_type == 0 { | ||
header.pic_order_cnt_lsb = | ||
r.read_bits(usize::from(sps.log2_max_pic_order_cnt_lsb_minus4) + 4)?; | ||
|
@@ -2451,6 +2462,7 @@ impl Parser { | |
header.delta_pic_order_cnt[1] = r.read_se()?; | ||
} | ||
} | ||
header.pic_order_cnt_bit_size = num_bits_left - r.num_bits_left(); | ||
|
||
if pps.redundant_pic_cnt_present_flag { | ||
header.redundant_pic_cnt = r.read_ue_max(127)?; | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't matter which backend requires this - the parser should be backend-agnostic, so no need to mention V4L2 here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. If it is only needed for V4L2 purpose, it might not be a right place to calculate here in the first place. My todo to check and move this if relevant.