Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2663)

Unified Diff: webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc

Issue 2499003002: H264 encoder: Include QP information in encoded images (Closed)
Patch Set: Set QP for HW encoders as well. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc
diff --git a/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc b/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc
index 5c0aa1bd4507206de1cf3277c3f282438d3dc623..a7c7a9db686ed51903f5e8bdf83d4c89acbaddf7 100644
--- a/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc
+++ b/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc
@@ -374,18 +374,20 @@ int32_t H264EncoderImpl::Encode(const VideoFrame& input_frame,
// Encoder can skip frames to save bandwidth in which case
// |encoded_image_._length| == 0.
if (encoded_image_._length > 0) {
- // Deliver encoded image.
- CodecSpecificInfo codec_specific;
- codec_specific.codecType = kVideoCodecH264;
- encoded_image_callback_->OnEncodedImage(encoded_image_, &codec_specific,
- &frag_header);
-
// Parse and report QP.
h264_bitstream_parser_.ParseBitstream(encoded_image_._buffer,
encoded_image_._length);
int qp = -1;
- if (h264_bitstream_parser_.GetLastSliceQp(&qp))
+ if (h264_bitstream_parser_.GetLastSliceQp(&qp)) {
quality_scaler_.ReportQP(qp);
+ encoded_image_.qp_ = qp;
+ }
+
+ // Deliver encoded image.
+ CodecSpecificInfo codec_specific;
+ codec_specific.codecType = kVideoCodecH264;
+ encoded_image_callback_->OnEncodedImage(encoded_image_, &codec_specific,
+ &frag_header);
} else {
quality_scaler_.ReportDroppedFrame();
}
« no previous file with comments | « webrtc/api/android/jni/androidmediaencoder_jni.cc ('k') | webrtc/sdk/objc/Framework/Classes/h264_video_toolbox_encoder.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698