@@ -147,18 +147,6 @@ AvifDecoder::~AvifDecoder() {
147
147
148
148
size_t AvifDecoder::signatureLength () const { return kAvifSignatureSize ; }
149
149
150
- bool AvifDecoder::checkSignature (const String &signature) const {
151
- avifDecoder *decoder = avifDecoderCreate ();
152
- if (!decoder) return false ;
153
- avifDecoderSetIOMemory (decoder,
154
- reinterpret_cast <const uint8_t *>(signature.c_str ()),
155
- signature.size ());
156
- decoder->io ->sizeHint = 1e9 ;
157
- const avifResult status = avifDecoderParse (decoder);
158
- avifDecoderDestroy (decoder);
159
- return (status == AVIF_RESULT_OK || status == AVIF_RESULT_TRUNCATED_DATA);
160
- }
161
-
162
150
#define OPENCV_AVIF_CHECK_STATUS (X, ENCDEC ) \
163
151
{ \
164
152
const avifResult status = (X); \
@@ -170,6 +158,20 @@ bool AvifDecoder::checkSignature(const String &signature) const {
170
158
} \
171
159
}
172
160
161
+ bool AvifDecoder::checkSignature (const String &signature) const {
162
+ avifDecoder *decoder = avifDecoderCreate ();
163
+ if (!decoder) return false ;
164
+ OPENCV_AVIF_CHECK_STATUS (
165
+ avifDecoderSetIOMemory (
166
+ decoder, reinterpret_cast <const uint8_t *>(signature.c_str ()),
167
+ signature.size ()),
168
+ decoder);
169
+ decoder->io ->sizeHint = 1e9 ;
170
+ const avifResult status = avifDecoderParse (decoder);
171
+ avifDecoderDestroy (decoder);
172
+ return (status == AVIF_RESULT_OK || status == AVIF_RESULT_TRUNCATED_DATA);
173
+ }
174
+
173
175
ImageDecoder AvifDecoder::newDecoder () const { return makePtr<AvifDecoder>(); }
174
176
175
177
bool AvifDecoder::readHeader () {
0 commit comments