• 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_VP9_ENC_H__
18 #define ANDROID_C2_SOFT_VP9_ENC_H__
19 
20 #include "C2SoftVpxEnc.h"
21 
22 namespace android {
23 
24 // Exposes vp9 encoder as a c2 Component
25 //
26 // In addition to the base class settings, Only following encoder settings are
27 // available:
28 //    - tile rows
29 //    - tile columns
30 //    - frame parallel mode
31 struct C2SoftVp9Enc : public C2SoftVpxEnc {
32     C2SoftVp9Enc(const char* name, c2_node_id_t id,
33                  const std::shared_ptr<IntfImpl>& intfImpl);
34     C2SoftVp9Enc(const char* name, c2_node_id_t id,
35                  const std::shared_ptr<C2ReflectorHelper>& helper);
36 
37  protected:
38     // Populates |mCodecInterface| with codec specific settings.
39     virtual void setCodecSpecificInterface();
40 
41     // Sets codec specific configuration.
42     virtual void setCodecSpecificConfiguration();
43 
44     // Initializes codec specific encoder settings.
45     virtual vpx_codec_err_t setCodecSpecificControls();
46 
47  private:
48     // C2 Profile & Level parameter
49     int32_t mProfile;
50     int32_t mLevel __unused;
51 
52     int32_t mTileColumns;
53 
54     bool mFrameParallelDecoding;
55 
56     C2_DO_NOT_COPY(C2SoftVp9Enc);
57 };
58 
59 }  // namespace android
60 
61 #endif  // ANDROID_C2_SOFT_VP9_ENC_H__
62