Skip to content
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

264_enc: apply encode base class for AVC SVC-T #7

Open
wants to merge 10 commits into
base: vp8svct
Choose a base branch
from

Conversation

wudping
Copy link

@wudping wudping commented Jun 23, 2017

Calling base class's functions to set framerate and bitrate for
AVC SVC-T encoding.

Signed-off-by: wudping [email protected]

As reading whole buffer, m_next should equal to m_end after finishing
the operation.

Signed-off-by: wudping <[email protected]>
Modify the NALREADER_TEST ReadAsUnits and ReadAsWhole to make them compatible
with new NalReader behaviors.

Signed-off-by: wudping <[email protected]>
When the width or hight overflows the maxmum value of int,
guessResolution() returns false.

Signed-off-by: wudping <[email protected]>
rateControl->bits_per_second = ((temproalID == 0) ?
m_videoParamCommon.rcParams.bitRate : m_videoParamCommon.temporalLayers.bitRate[temproalID-1]);
rateControl->bits_per_second =
(temproalID + 1) == m_videoParamCommon.temporalLayers.numLayers ? bitRate() : m_videoParamCommon.temporalLayers.bitRate[temproalID];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better change it to temproalID == (m_videoParamCommon.temporalLayers.numLayers - 1) and add some comments

//layer 1 framterate is frameRate[0]
//layer 1 birate is bitRate[0]
//framerate of the highest layer is VideoParamsCommon.frameRate
//bitrate of the highest layer is VideoParamsCommon.rcParams.bitRate
uint8_t numLayers;
VideoFrameRate frameRate[32];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we do not need user set this any more, could we move this to VaapiEncBase?

@@ -514,13 +509,12 @@ bool VaapiEncoderBase::ensureMiscParams (VaapiEncPicture* picture)
if (mode == RATE_CONTROL_CBR ||
mode == RATE_CONTROL_VBR) {
//+1 for layer 0
uint32_t layers = m_videoParamCommon.temporalLayers.numLayers + 1;
uint32_t layers = m_videoParamCommon.temporalLayers.numLayers;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove this +1?

rate = &m_videoParamCommon.temporalLayers.frameRate[temproalID-1];
}
frameRate->framerate = (rate->frameRateNum<<16) | rate->frameRateDenom;
frameRate->framerate = m_videoParamCommon.temporalLayers.frameRate[temproalID].frameRateNum | (m_videoParamCommon.temporalLayers.frameRate[temproalID].frameRateDenom << 16);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need set highest layer's frame rate?

@wudping wudping force-pushed the gx_vp8svct branch 3 times, most recently from f277137 to 2463b3b Compare June 26, 2017 01:46
@@ -91,6 +91,7 @@ typedef enum {
#define VIDEO_PARAMS_QUALITYLEVEL_NONE 0
#define VIDEO_PARAMS_QUALITYLEVEL_MIN 1
#define VIDEO_PARAMS_QUALITYLEVEL_MAX 7
#define SVCT_RATE_BUFFER_LENGTH 32
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change to TEMPORAL_LAYER_LENGTH_MAX

@@ -474,7 +474,7 @@ bool VaapiEncoderVP8::fill(VAEncPictureParameterBufferVP8* picParam, const Pictu
}

picParam->coded_buf = picture->getCodedBufferID();
picParam->ref_flags.bits.temporal_id = picture->m_temporalID;
//picParam->ref_flags.bits.temporal_id = picture->m_temporalID;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we need remove this

Vp8EncoderSvct(const VideoParamsCommon& common);

Vp8EncoderSvct(uint8_t layerNum)
: m_layerNum(layerNum % (VP8_MAX_TEMPORAL_LAYER_NUM + 1))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove +1 here, then you do not need -1 at getTemporalLayer

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If so, the m_layerNum will not equal to the real layer number.

@wudping wudping force-pushed the gx_vp8svct branch 3 times, most recently from 1efcabf to a87b2b4 Compare June 27, 2017 03:21
we will use this for h264 and vp8 temporal encoder, hope it can apply to
all svct encoders.
so we can remove duplicate code in h264 and vp8 svct encoder
all fields move to VideoTemporalLayers
this is preparation for vp8 svct encoder

Signed-off-by: wudping <[email protected]>
Signed-off-by: Xu Guangxin <[email protected]>
user can use this field to select output dest.
frames in diffrent layer may put in diffrent rtp packet

Signed-off-by: wudping <[email protected]>
Signed-off-by: Xu Guangxin <[email protected]>
Signed-off-by: wudping <[email protected]>
Signed-off-by: Xu Guangxin <[email protected]>
the getLayerIds logical is complicate, we can revisit it later

Signed-off-by: wudping <[email protected]>
Signed-off-by: Xu Guangxin <[email protected]>
typedef struct VideoTemproalLayers {
//bitrate of the highest layer is VideoParamsCommon.rcParams.bitRate
uint8_t numLayersMinus1;
uint32_t bitRate[TEMPORAL_LAYER_LENGTH_MAX];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change this to NUM_TEMPLAYER_MAX.
add add following comment
//layer 0 bitrate is bitRate[0]
//...
//layer highest birate is VideoParamsCommon.rcParams.bitRate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants