Changeset View
Changeset View
Standalone View
Standalone View
extern/draco/draco/src/draco/compression/config/encoder_options.h
- This file was moved from extern/draco/dracoenc/src/draco/compression/config/encoder_options.h.
| Show All 9 Lines | |||||
| // distributed under the License is distributed on an "AS IS" BASIS, | // distributed under the License is distributed on an "AS IS" BASIS, | ||||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
| // See the License for the specific language governing permissions and | // See the License for the specific language governing permissions and | ||||
| // limitations under the License. | // limitations under the License. | ||||
| // | // | ||||
| #ifndef DRACO_COMPRESSION_CONFIG_ENCODER_OPTIONS_H_ | #ifndef DRACO_COMPRESSION_CONFIG_ENCODER_OPTIONS_H_ | ||||
| #define DRACO_COMPRESSION_CONFIG_ENCODER_OPTIONS_H_ | #define DRACO_COMPRESSION_CONFIG_ENCODER_OPTIONS_H_ | ||||
| #include "draco/draco_features.h" | |||||
| #include "draco/attributes/geometry_attribute.h" | #include "draco/attributes/geometry_attribute.h" | ||||
| #include "draco/compression/config/draco_options.h" | #include "draco/compression/config/draco_options.h" | ||||
| #include "draco/compression/config/encoding_features.h" | #include "draco/compression/config/encoding_features.h" | ||||
| #include "draco/draco_features.h" | |||||
| namespace draco { | namespace draco { | ||||
| // EncoderOptions allow users to specify so called feature options that are used | // EncoderOptions allow users to specify so called feature options that are used | ||||
| // to inform the encoder which encoding features can be used (i.e. which | // to inform the encoder which encoding features can be used (i.e. which | ||||
| // features are going to be available to the decoder). | // features are going to be available to the decoder). | ||||
| template <typename AttributeKeyT> | template <typename AttributeKeyT> | ||||
| class EncoderOptionsBase : public DracoOptions<AttributeKeyT> { | class EncoderOptionsBase : public DracoOptions<AttributeKeyT> { | ||||
| Show All 20 Lines | int GetDecodingSpeed() const { | ||||
| return this->GetGlobalInt("decoding_speed", 5); | return this->GetGlobalInt("decoding_speed", 5); | ||||
| } | } | ||||
| // Returns the maximum speed for both encoding/decoding. | // Returns the maximum speed for both encoding/decoding. | ||||
| int GetSpeed() const { | int GetSpeed() const { | ||||
| const int encoding_speed = this->GetGlobalInt("encoding_speed", -1); | const int encoding_speed = this->GetGlobalInt("encoding_speed", -1); | ||||
| const int decoding_speed = this->GetGlobalInt("decoding_speed", -1); | const int decoding_speed = this->GetGlobalInt("decoding_speed", -1); | ||||
| const int max_speed = std::max(encoding_speed, decoding_speed); | const int max_speed = std::max(encoding_speed, decoding_speed); | ||||
| if (max_speed == -1) | if (max_speed == -1) { | ||||
| return 5; // Default value. | return 5; // Default value. | ||||
| } | |||||
| return max_speed; | return max_speed; | ||||
| } | } | ||||
| void SetSpeed(int encoding_speed, int decoding_speed) { | void SetSpeed(int encoding_speed, int decoding_speed) { | ||||
| this->SetGlobalInt("encoding_speed", encoding_speed); | this->SetGlobalInt("encoding_speed", encoding_speed); | ||||
| this->SetGlobalInt("decoding_speed", decoding_speed); | this->SetGlobalInt("decoding_speed", decoding_speed); | ||||
| } | } | ||||
| Show All 29 Lines | |||||