Pawin Vongmasa | 3665390 | 2018-11-15 00:10:25 -0800 | [diff] [blame] | 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 | |
| 33 | protected: |
| 34 | // Populates |mCodecInterface| with codec specific settings. |
| 35 | virtual void setCodecSpecificInterface(); |
| 36 | |
| 37 | // Sets codec specific configuration. |
| 38 | virtual void setCodecSpecificConfiguration(); |
| 39 | |
| 40 | // Initializes codec specific encoder settings. |
| 41 | virtual vpx_codec_err_t setCodecSpecificControls(); |
| 42 | |
| 43 | private: |
| 44 | // Max value supported for DCT partitions |
| 45 | static const uint32_t kMaxDCTPartitions = 3; |
| 46 | |
| 47 | // vp8 specific configuration parameter |
| 48 | // that enables token partitioning of |
| 49 | // the stream into substreams |
| 50 | int32_t mDCTPartitions; |
| 51 | |
| 52 | // C2 Profile parameter |
| 53 | int32_t mProfile; |
| 54 | |
| 55 | C2_DO_NOT_COPY(C2SoftVp8Enc); |
| 56 | }; |
| 57 | |
| 58 | } // namespace android |
| 59 | |
| 60 | #endif // ANDROID_C2_SOFT_VP8_ENC_H__ |