• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2018 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef ANDROID_C2_SOFT_VP8_ENC_H__
18 #define ANDROID_C2_SOFT_VP8_ENC_H__
19 
20 #include "C2SoftVpxEnc.h"
21 
22 namespace android {
23 
24 // Exposes vp8 encoder as a c2 Component
25 //
26 // In addition to the base class settings, Only following encoder settings are
27 // available:
28 //    - token partitioning
29 struct C2SoftVp8Enc : public C2SoftVpxEnc {
30     C2SoftVp8Enc(const char* name, c2_node_id_t id,
31                  const std::shared_ptr<IntfImpl>& intfImpl);
32     C2SoftVp8Enc(const char* name, c2_node_id_t id,
33                  const std::shared_ptr<C2ReflectorHelper>& helper);
34 
35  protected:
36     // Populates |mCodecInterface| with codec specific settings.
37     virtual void setCodecSpecificInterface();
38 
39     // Sets codec specific configuration.
40     virtual void setCodecSpecificConfiguration();
41 
42     // Initializes codec specific encoder settings.
43     virtual vpx_codec_err_t setCodecSpecificControls();
44 
45  private:
46     // Max value supported for DCT partitions
47     static const uint32_t kMaxDCTPartitions = 3;
48 
49     // vp8 specific configuration parameter
50     // that enables token partitioning of
51     // the stream into substreams
52     int32_t mDCTPartitions;
53 
54     // C2 Profile parameter
55     int32_t mProfile;
56 
57     C2_DO_NOT_COPY(C2SoftVp8Enc);
58 };
59 
60 }  // namespace android
61 
62 #endif  // ANDROID_C2_SOFT_VP8_ENC_H__
63