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 
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     // C2 Profile & Level parameter
47     int32_t mProfile;
48     int32_t mLevel __unused;
49 
50     int32_t mTileColumns;
51 
52     bool mFrameParallelDecoding;
53 
54     C2_DO_NOT_COPY(C2SoftVp9Enc);
55 };
56 
57 }  // namespace android
58 
59 #endif  // ANDROID_C2_SOFT_VP9_ENC_H__
60