-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: vp8svct
Are you sure you want to change the base?
Conversation
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]>
encoder/vaapiencoder_base.cpp
Outdated
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]; |
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.
better change it to temproalID == (m_videoParamCommon.temporalLayers.numLayers - 1) and add some comments
interface/VideoEncoderDefs.h
Outdated
//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]; |
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.
since we do not need user set this any more, could we move this to VaapiEncBase?
encoder/vaapiencoder_base.cpp
Outdated
@@ -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; |
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.
why remove this +1?
encoder/vaapiencoder_base.cpp
Outdated
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); |
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.
Do we need set highest layer's frame rate?
f277137
to
2463b3b
Compare
interface/VideoEncoderDefs.h
Outdated
@@ -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 |
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.
Please change to TEMPORAL_LAYER_LENGTH_MAX
encoder/vaapiencoder_vp8.cpp
Outdated
@@ -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; |
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.
why we need remove this
encoder/vaapiencoder_vp8.cpp
Outdated
Vp8EncoderSvct(const VideoParamsCommon& common); | ||
|
||
Vp8EncoderSvct(uint8_t layerNum) | ||
: m_layerNum(layerNum % (VP8_MAX_TEMPORAL_LAYER_NUM + 1)) |
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.
remove +1 here, then you do not need -1 at getTemporalLayer
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.
If so, the m_layerNum will not equal to the real layer number.
1efcabf
to
a87b2b4
Compare
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]; |
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.
Please change this to NUM_TEMPLAYER_MAX.
add add following comment
//layer 0 bitrate is bitRate[0]
//...
//layer highest birate is VideoParamsCommon.rcParams.bitRate
Calling base class's functions to set framerate and bitrate for
AVC SVC-T encoding.
Signed-off-by: wudping [email protected]