Package: chromium-browser / 70.0.3538.110-1~deb9u1

system/vpx.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
description: maintain compatibility with vpx 1.7
author: Michael Gilbert <mgilbert@debian.org>

--- a/media/base/decode_capabilities.cc
+++ b/media/base/decode_capabilities.cc
@@ -12,8 +12,8 @@
 #include "ui/display/display_switches.h"
 
 #if BUILDFLAG(ENABLE_LIBVPX)
-#include "third_party/libvpx/source/libvpx/vpx/vp8dx.h"
-#include "third_party/libvpx/source/libvpx/vpx/vpx_codec.h"
+#include <vpx/vp8dx.h>
+#include <vpx/vpx_codec.h>
 #endif
 
 namespace media {
--- a/third_party/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc
+++ b/third_party/webrtc/modules/video_coding/codecs/vp9/vp9_impl.cc
@@ -15,10 +15,10 @@
 #include <limits>
 #include <vector>
 
-#include "vpx/vp8cx.h"
-#include "vpx/vp8dx.h"
-#include "vpx/vpx_decoder.h"
-#include "vpx/vpx_encoder.h"
+#include <vpx/vp8cx.h>
+#include <vpx/vp8dx.h>
+#include <vpx/vpx_decoder.h>
+#include <vpx/vpx_encoder.h>
 
 #include "absl/memory/memory.h"
 #include "api/video/color_space.h"
@@ -577,34 +577,6 @@ int VP9EncoderImpl::InitAndSetControlSet
     vpx_codec_control(encoder_, VP9E_SET_SVC_PARAMETERS, &svc_params_);
   }
 
-  if (num_spatial_layers_ > 1) {
-    switch (inter_layer_pred_) {
-      case InterLayerPredMode::kOn:
-        vpx_codec_control(encoder_, VP9E_SET_SVC_INTER_LAYER_PRED, 0);
-        break;
-      case InterLayerPredMode::kOff:
-        vpx_codec_control(encoder_, VP9E_SET_SVC_INTER_LAYER_PRED, 1);
-        break;
-      case InterLayerPredMode::kOnKeyPic:
-        vpx_codec_control(encoder_, VP9E_SET_SVC_INTER_LAYER_PRED, 2);
-        break;
-      default:
-        RTC_NOTREACHED();
-    }
-
-    // Configure encoder to drop entire superframe whenever it needs to drop
-    // a layer. This mode is prefered over per-layer dropping which causes
-    // quality flickering and is not compatible with RTP non-flexible mode.
-    vpx_svc_frame_drop_t svc_drop_frame;
-    memset(&svc_drop_frame, 0, sizeof(svc_drop_frame));
-    svc_drop_frame.framedrop_mode = FULL_SUPERFRAME_DROP;
-    svc_drop_frame.max_consec_drop = std::numeric_limits<int>::max();
-    for (size_t i = 0; i < num_spatial_layers_; ++i) {
-      svc_drop_frame.framedrop_thresh[i] = config_->rc_dropframe_thresh;
-    }
-    vpx_codec_control(encoder_, VP9E_SET_SVC_FRAME_DROP_LAYER, &svc_drop_frame);
-  }
-
   // Register callback for getting each spatial layer.
   vpx_codec_priv_output_cx_pkt_cb_pair_t cbp = {
       VP9EncoderImpl::EncoderOutputCodedPacketCallback,
@@ -821,10 +793,8 @@ void VP9EncoderImpl::PopulateCodecSpecif
   vp9_info->num_spatial_layers = num_active_spatial_layers_;
 
   vp9_info->num_ref_pics = 0;
-  if (vp9_info->flexible_mode) {
+  if (false) {
     vp9_info->gof_idx = kNoGofIdx;
-    FillReferenceIndices(pkt, pics_since_key_, vp9_info->inter_layer_predicted,
-                         vp9_info);
   } else {
     vp9_info->gof_idx =
         static_cast<uint8_t>(pics_since_key_ % gof_.num_frames_in_gof);
@@ -850,6 +820,7 @@ void VP9EncoderImpl::PopulateCodecSpecif
   }
 }
 
+/*
 void VP9EncoderImpl::FillReferenceIndices(const vpx_codec_cx_pkt& pkt,
                                           const size_t pic_num,
                                           const bool inter_layer_predicted,
@@ -980,6 +951,7 @@ void VP9EncoderImpl::UpdateReferenceBuff
     ref_buf_[0] = frame_buf;
   }
 }
+*/
 
 int VP9EncoderImpl::GetEncodedLayerFrame(const vpx_codec_cx_pkt* pkt) {
   RTC_DCHECK_EQ(pkt->kind, VPX_CODEC_CX_FRAME_PKT);
@@ -1024,10 +996,6 @@ int VP9EncoderImpl::GetEncodedLayerFrame
   PopulateCodecSpecific(&codec_specific_, *pkt, input_image_->timestamp(),
                         first_frame_in_picture);
 
-  if (is_flexible_mode_) {
-    UpdateReferenceBuffers(*pkt, pics_since_key_);
-  }
-
   TRACE_COUNTER1("webrtc", "EncodedFrameSize", encoded_image_._length);
   encoded_image_.SetTimestamp(input_image_->timestamp());
   encoded_image_.capture_time_ms_ = input_image_->render_time_ms();
@@ -1035,10 +1003,8 @@ int VP9EncoderImpl::GetEncodedLayerFrame
   encoded_image_.content_type_ = (codec_.mode == VideoCodecMode::kScreensharing)
                                      ? VideoContentType::SCREENSHARE
                                      : VideoContentType::UNSPECIFIED;
-  encoded_image_._encodedHeight =
-      pkt->data.frame.height[layer_id.spatial_layer_id];
-  encoded_image_._encodedWidth =
-      pkt->data.frame.width[layer_id.spatial_layer_id];
+  encoded_image_._encodedHeight = raw_->d_h;
+  encoded_image_._encodedWidth = raw_->d_w;
   encoded_image_.timing_.flags = VideoSendTiming::kInvalid;
   int qp = -1;
   vpx_codec_control(encoder_, VP8E_GET_LAST_QUANTIZER, &qp);