@revizly/sharp-libvips-dev 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/include/expat.h +19 -9
  2. package/include/expat_config.h +11 -5
  3. package/include/ffi.h +12 -25
  4. package/include/freetype2/freetype/config/ftoption.h +1 -1
  5. package/include/gio-unix-2.0/gio/gfiledescriptorbased.h +3 -2
  6. package/include/glib-2.0/gio/gapplication.h +6 -0
  7. package/include/glib-2.0/gio/giotypes.h +0 -1
  8. package/include/glib-2.0/girepository/giarginfo.h +23 -6
  9. package/include/glib-2.0/girepository/gibaseinfo.h +44 -18
  10. package/include/glib-2.0/girepository/gicallableinfo.h +26 -16
  11. package/include/glib-2.0/girepository/gicallbackinfo.h +17 -2
  12. package/include/glib-2.0/girepository/giconstantinfo.h +19 -4
  13. package/include/glib-2.0/girepository/gienuminfo.h +20 -21
  14. package/include/glib-2.0/girepository/gifieldinfo.h +22 -7
  15. package/include/glib-2.0/girepository/giflagsinfo.h +60 -0
  16. package/include/glib-2.0/girepository/gifunctioninfo.h +22 -7
  17. package/include/glib-2.0/girepository/giinterfaceinfo.h +33 -18
  18. package/include/glib-2.0/girepository/giobjectinfo.h +41 -26
  19. package/include/glib-2.0/girepository/gipropertyinfo.h +18 -3
  20. package/include/glib-2.0/girepository/giregisteredtypeinfo.h +22 -11
  21. package/include/glib-2.0/girepository/girepository.h +49 -62
  22. package/include/glib-2.0/girepository/girffi.h +7 -7
  23. package/include/glib-2.0/girepository/gisignalinfo.h +18 -3
  24. package/include/glib-2.0/girepository/gistructinfo.h +26 -11
  25. package/include/glib-2.0/girepository/gitypeinfo.h +29 -16
  26. package/include/glib-2.0/girepository/gitypelib.h +9 -13
  27. package/include/glib-2.0/girepository/gitypes.h +52 -104
  28. package/include/glib-2.0/girepository/giunioninfo.h +28 -12
  29. package/include/glib-2.0/girepository/giunresolvedinfo.h +17 -2
  30. package/include/glib-2.0/girepository/givalueinfo.h +65 -0
  31. package/include/glib-2.0/girepository/givfuncinfo.h +23 -8
  32. package/include/glib-2.0/glib/deprecated/gthread.h +9 -5
  33. package/include/glib-2.0/glib/gbitlock.h +31 -0
  34. package/include/glib-2.0/glib/gmessages.h +5 -0
  35. package/include/glib-2.0/glib/gslice.h +2 -0
  36. package/include/glib-2.0/glib/gstrfuncs.h +24 -18
  37. package/include/glib-2.0/glib/gthread.h +191 -3
  38. package/include/glib-2.0/glib-unix.h +7 -1
  39. package/include/glib-2.0/gobject/genums.h +6 -6
  40. package/include/glib-2.0/gobject/glib-types.h +11 -0
  41. package/include/hwy/aligned_allocator.h +171 -6
  42. package/include/hwy/base.h +1765 -543
  43. package/include/hwy/cache_control.h +24 -6
  44. package/include/hwy/detect_compiler_arch.h +23 -2
  45. package/include/hwy/detect_targets.h +56 -13
  46. package/include/hwy/foreach_target.h +24 -0
  47. package/include/hwy/highway.h +20 -3
  48. package/include/hwy/ops/arm_neon-inl.h +1086 -667
  49. package/include/hwy/ops/arm_sve-inl.h +1091 -235
  50. package/include/hwy/ops/emu128-inl.h +271 -196
  51. package/include/hwy/ops/generic_ops-inl.h +2270 -399
  52. package/include/hwy/ops/ppc_vsx-inl.h +1786 -563
  53. package/include/hwy/ops/rvv-inl.h +1043 -311
  54. package/include/hwy/ops/scalar-inl.h +189 -159
  55. package/include/hwy/ops/set_macros-inl.h +66 -6
  56. package/include/hwy/ops/shared-inl.h +175 -56
  57. package/include/hwy/ops/wasm_128-inl.h +153 -136
  58. package/include/hwy/ops/x86_128-inl.h +1647 -646
  59. package/include/hwy/ops/x86_256-inl.h +1003 -370
  60. package/include/hwy/ops/x86_512-inl.h +948 -353
  61. package/include/hwy/per_target.h +4 -0
  62. package/include/hwy/profiler.h +648 -0
  63. package/include/hwy/robust_statistics.h +2 -2
  64. package/include/hwy/targets.h +18 -11
  65. package/include/hwy/timer.h +11 -0
  66. package/include/libde265/de265-version.h +36 -0
  67. package/include/libde265/de265.h +453 -0
  68. package/include/libde265/en265.h +218 -0
  69. package/include/libpng16/png.h +32 -29
  70. package/include/libpng16/pngconf.h +2 -2
  71. package/include/libpng16/pnglibconf.h +7 -2
  72. package/include/librsvg-2.0/librsvg/rsvg-version.h +2 -2
  73. package/include/librsvg-2.0/librsvg/rsvg.h +7 -1
  74. package/include/libxml2/libxml/parser.h +16 -7
  75. package/include/libxml2/libxml/xmlIO.h +0 -1
  76. package/include/libxml2/libxml/xmlversion.h +4 -4
  77. package/include/pango-1.0/pango/pango-features.h +2 -2
  78. package/include/pango-1.0/pango/pango-fontmap.h +7 -0
  79. package/include/pixman-1/pixman-version.h +2 -2
  80. package/include/png.h +32 -29
  81. package/include/pngconf.h +2 -2
  82. package/include/pnglibconf.h +7 -2
  83. package/package.json +1 -1
  84. package/versions.json +11 -10
@@ -127,6 +127,13 @@ static inline HWY_MAYBE_UNUSED const char* TargetName(int64_t target) {
127
127
  return "PPC10";
128
128
  #endif
129
129
 
130
+ #if HWY_ARCH_S390X
131
+ case HWY_Z14:
132
+ return "Z14";
133
+ case HWY_Z15:
134
+ return "Z15";
135
+ #endif
136
+
130
137
  #if HWY_ARCH_WASM
131
138
  case HWY_WASM:
132
139
  return "WASM";
@@ -245,20 +252,20 @@ static inline HWY_MAYBE_UNUSED const char* TargetName(int64_t target) {
245
252
  HWY_CHOOSE_RVV(func_name), /* RVV */ \
246
253
  nullptr /* reserved */
247
254
 
248
- #elif HWY_ARCH_PPC
255
+ #elif HWY_ARCH_PPC || HWY_ARCH_S390X
249
256
  // See HWY_ARCH_X86 above for details.
250
257
  #define HWY_MAX_DYNAMIC_TARGETS 9
251
258
  #define HWY_HIGHEST_TARGET_BIT HWY_HIGHEST_TARGET_BIT_PPC
252
- #define HWY_CHOOSE_TARGET_LIST(func_name) \
253
- nullptr, /* reserved */ \
254
- nullptr, /* reserved */ \
255
- nullptr, /* reserved */ \
256
- nullptr, /* reserved */ \
257
- HWY_CHOOSE_PPC10(func_name), /* PPC10 */ \
258
- HWY_CHOOSE_PPC9(func_name), /* PPC9 */ \
259
- HWY_CHOOSE_PPC8(func_name), /* PPC8 */ \
260
- nullptr, /* reserved (VSX or AltiVec) */ \
261
- nullptr /* reserved (VSX or AltiVec) */
259
+ #define HWY_CHOOSE_TARGET_LIST(func_name) \
260
+ nullptr, /* reserved */ \
261
+ nullptr, /* reserved */ \
262
+ nullptr, /* reserved */ \
263
+ nullptr, /* reserved */ \
264
+ HWY_CHOOSE_PPC10(func_name), /* PPC10 */ \
265
+ HWY_CHOOSE_PPC9(func_name), /* PPC9 */ \
266
+ HWY_CHOOSE_PPC8(func_name), /* PPC8 */ \
267
+ HWY_CHOOSE_Z15(func_name), /* Z15 */ \
268
+ HWY_CHOOSE_Z14(func_name) /* Z14 */
262
269
 
263
270
  #elif HWY_ARCH_WASM
264
271
  // See HWY_ARCH_X86 above for details.
@@ -50,6 +50,17 @@ HWY_DLLEXPORT double InvariantTicksPerSecond();
50
50
  HWY_DLLEXPORT uint64_t TimerResolution();
51
51
 
52
52
  } // namespace platform
53
+
54
+ struct Timestamp {
55
+ Timestamp() { t = platform::Now(); }
56
+ double t;
57
+ };
58
+
59
+ static inline double SecondsSince(const Timestamp& t0) {
60
+ const Timestamp t1;
61
+ return t1.t - t0.t;
62
+ }
63
+
53
64
  } // namespace hwy
54
65
 
55
66
  #endif // HIGHWAY_HWY_TIMER_H_
@@ -0,0 +1,36 @@
1
+ /*
2
+ * H.265 video codec.
3
+ * Copyright (c) 2013-2014 struktur AG, Dirk Farin <farin@struktur.de>
4
+ *
5
+ * This file is part of libde265.
6
+ *
7
+ * libde265 is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as
9
+ * published by the Free Software Foundation, either version 3 of
10
+ * the License, or (at your option) any later version.
11
+ *
12
+ * libde265 is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with libde265. If not, see <http://www.gnu.org/licenses/>.
19
+ */
20
+
21
+ /* de265-version.h
22
+ *
23
+ * This file was generated by autoconf when libde265 was built.
24
+ *
25
+ * DO NOT EDIT THIS FILE.
26
+ */
27
+ #ifndef LIBDE265_VERSION_H
28
+ #define LIBDE265_VERSION_H
29
+
30
+ /* Numeric representation of the version */
31
+ #define LIBDE265_NUMERIC_VERSION 0x01001500
32
+
33
+ /* Version string */
34
+ #define LIBDE265_VERSION "1.0.15"
35
+
36
+ #endif
@@ -0,0 +1,453 @@
1
+ /*
2
+ * H.265 video codec.
3
+ * Copyright (c) 2013-2014 struktur AG, Dirk Farin <farin@struktur.de>
4
+ *
5
+ * This file is part of libde265.
6
+ *
7
+ * libde265 is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as
9
+ * published by the Free Software Foundation, either version 3 of
10
+ * the License, or (at your option) any later version.
11
+ *
12
+ * libde265 is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with libde265. If not, see <http://www.gnu.org/licenses/>.
19
+ */
20
+
21
+
22
+ #ifndef DE265_H
23
+ #define DE265_H
24
+
25
+ #ifdef __cplusplus
26
+ extern "C" {
27
+ #endif
28
+
29
+ #include <libde265/de265-version.h>
30
+
31
+ //#define inline static __inline
32
+
33
+
34
+ #ifndef __STDC_LIMIT_MACROS
35
+ #define __STDC_LIMIT_MACROS 1
36
+ #endif
37
+ #include <stdint.h>
38
+
39
+ #if defined(_MSC_VER) && !defined(LIBDE265_STATIC_BUILD)
40
+ #ifdef LIBDE265_EXPORTS
41
+ #define LIBDE265_API __declspec(dllexport)
42
+ #else
43
+ #define LIBDE265_API __declspec(dllimport)
44
+ #endif
45
+ #elif HAVE_VISIBILITY
46
+ #ifdef LIBDE265_EXPORTS
47
+ #define LIBDE265_API __attribute__((__visibility__("default")))
48
+ #else
49
+ #define LIBDE265_API
50
+ #endif
51
+ #else
52
+ #define LIBDE265_API
53
+ #endif
54
+
55
+ #if __GNUC__
56
+ #define LIBDE265_DEPRECATED __attribute__((deprecated))
57
+ #elif defined(_MSC_VER)
58
+ #define LIBDE265_DEPRECATED __declspec(deprecated)
59
+ #else
60
+ #define LIBDE265_DEPRECATED
61
+ #endif
62
+
63
+ #if defined(_MSC_VER)
64
+ #define LIBDE265_INLINE __inline
65
+ #else
66
+ #define LIBDE265_INLINE inline
67
+ #endif
68
+
69
+ /* === version numbers === */
70
+
71
+ // version of linked libde265 library
72
+ LIBDE265_API const char *de265_get_version(void);
73
+
74
+ // returns the version number as a BCD number.
75
+ // 0xAABBCCDD is interpreted as version AA.BB.CC.
76
+ // For example: 0x02143000 is version 2.14.30
77
+ LIBDE265_API uint32_t de265_get_version_number(void);
78
+
79
+ LIBDE265_API int de265_get_version_number_major(void);
80
+ LIBDE265_API int de265_get_version_number_minor(void);
81
+ LIBDE265_API int de265_get_version_number_maintenance(void);
82
+
83
+
84
+ /* === error codes === */
85
+
86
+ typedef enum {
87
+ DE265_OK = 0,
88
+ DE265_ERROR_NO_SUCH_FILE=1,
89
+ //DE265_ERROR_NO_STARTCODE=2, obsolet
90
+ //DE265_ERROR_EOF=3,
91
+ DE265_ERROR_COEFFICIENT_OUT_OF_IMAGE_BOUNDS=4,
92
+ DE265_ERROR_CHECKSUM_MISMATCH=5,
93
+ DE265_ERROR_CTB_OUTSIDE_IMAGE_AREA=6,
94
+ DE265_ERROR_OUT_OF_MEMORY=7,
95
+ DE265_ERROR_CODED_PARAMETER_OUT_OF_RANGE=8,
96
+ DE265_ERROR_IMAGE_BUFFER_FULL=9,
97
+ DE265_ERROR_CANNOT_START_THREADPOOL=10,
98
+ DE265_ERROR_LIBRARY_INITIALIZATION_FAILED=11,
99
+ DE265_ERROR_LIBRARY_NOT_INITIALIZED=12,
100
+ DE265_ERROR_WAITING_FOR_INPUT_DATA=13,
101
+ DE265_ERROR_CANNOT_PROCESS_SEI=14,
102
+ DE265_ERROR_PARAMETER_PARSING=15,
103
+ DE265_ERROR_NO_INITIAL_SLICE_HEADER=16,
104
+ DE265_ERROR_PREMATURE_END_OF_SLICE=17,
105
+ DE265_ERROR_UNSPECIFIED_DECODING_ERROR=18,
106
+
107
+ // --- errors that should become obsolete in later libde265 versions ---
108
+
109
+ //DE265_ERROR_MAX_THREAD_CONTEXTS_EXCEEDED = 500, obsolet
110
+ //DE265_ERROR_MAX_NUMBER_OF_SLICES_EXCEEDED = 501, obsolet
111
+ DE265_ERROR_NOT_IMPLEMENTED_YET = 502,
112
+ //DE265_ERROR_SCALING_LIST_NOT_IMPLEMENTED = 502, obsolet
113
+
114
+ // --- warnings ---
115
+
116
+ DE265_WARNING_NO_WPP_CANNOT_USE_MULTITHREADING = 1000,
117
+ DE265_WARNING_WARNING_BUFFER_FULL=1001,
118
+ DE265_WARNING_PREMATURE_END_OF_SLICE_SEGMENT=1002,
119
+ DE265_WARNING_INCORRECT_ENTRY_POINT_OFFSET=1003,
120
+ DE265_WARNING_CTB_OUTSIDE_IMAGE_AREA=1004,
121
+ DE265_WARNING_SPS_HEADER_INVALID=1005,
122
+ DE265_WARNING_PPS_HEADER_INVALID=1006,
123
+ DE265_WARNING_SLICEHEADER_INVALID=1007,
124
+ DE265_WARNING_INCORRECT_MOTION_VECTOR_SCALING=1008,
125
+ DE265_WARNING_NONEXISTING_PPS_REFERENCED=1009,
126
+ DE265_WARNING_NONEXISTING_SPS_REFERENCED=1010,
127
+ DE265_WARNING_BOTH_PREDFLAGS_ZERO=1011,
128
+ DE265_WARNING_NONEXISTING_REFERENCE_PICTURE_ACCESSED=1012,
129
+ DE265_WARNING_NUMMVP_NOT_EQUAL_TO_NUMMVQ=1013,
130
+ DE265_WARNING_NUMBER_OF_SHORT_TERM_REF_PIC_SETS_OUT_OF_RANGE=1014,
131
+ DE265_WARNING_SHORT_TERM_REF_PIC_SET_OUT_OF_RANGE=1015,
132
+ DE265_WARNING_FAULTY_REFERENCE_PICTURE_LIST=1016,
133
+ DE265_WARNING_EOSS_BIT_NOT_SET=1017,
134
+ DE265_WARNING_MAX_NUM_REF_PICS_EXCEEDED=1018,
135
+ DE265_WARNING_INVALID_CHROMA_FORMAT=1019,
136
+ DE265_WARNING_SLICE_SEGMENT_ADDRESS_INVALID=1020,
137
+ DE265_WARNING_DEPENDENT_SLICE_WITH_ADDRESS_ZERO=1021,
138
+ DE265_WARNING_NUMBER_OF_THREADS_LIMITED_TO_MAXIMUM=1022,
139
+ DE265_NON_EXISTING_LT_REFERENCE_CANDIDATE_IN_SLICE_HEADER=1023,
140
+ DE265_WARNING_CANNOT_APPLY_SAO_OUT_OF_MEMORY=1024,
141
+ DE265_WARNING_SPS_MISSING_CANNOT_DECODE_SEI=1025,
142
+ DE265_WARNING_COLLOCATED_MOTION_VECTOR_OUTSIDE_IMAGE_AREA=1026,
143
+ DE265_WARNING_PCM_BITDEPTH_TOO_LARGE=1027,
144
+ DE265_WARNING_REFERENCE_IMAGE_BIT_DEPTH_DOES_NOT_MATCH=1028,
145
+ DE265_WARNING_REFERENCE_IMAGE_SIZE_DOES_NOT_MATCH_SPS=1029,
146
+ DE265_WARNING_CHROMA_OF_CURRENT_IMAGE_DOES_NOT_MATCH_SPS=1030,
147
+ DE265_WARNING_BIT_DEPTH_OF_CURRENT_IMAGE_DOES_NOT_MATCH_SPS=1031,
148
+ DE265_WARNING_REFERENCE_IMAGE_CHROMA_FORMAT_DOES_NOT_MATCH=1032,
149
+ DE265_WARNING_INVALID_SLICE_HEADER_INDEX_ACCESS=1033
150
+ } de265_error;
151
+
152
+ LIBDE265_API const char* de265_get_error_text(de265_error err);
153
+
154
+ /* Returns true, if 'err' is DE265_OK or a warning.
155
+ */
156
+ LIBDE265_API int de265_isOK(de265_error err);
157
+
158
+ LIBDE265_API void de265_disable_logging(); // DEPRECATED
159
+ LIBDE265_API void de265_set_verbosity(int level);
160
+
161
+
162
+ /* === image === */
163
+
164
+ /* The image is currently always 3-channel YCbCr, with 4:2:0 chroma.
165
+ But you may want to check the chroma format anyway for future compatibility.
166
+ */
167
+
168
+ struct de265_image;
169
+
170
+ enum de265_chroma {
171
+ de265_chroma_mono=0,
172
+ de265_chroma_420=1,
173
+ de265_chroma_422=2,
174
+ de265_chroma_444=3
175
+ };
176
+
177
+ typedef int64_t de265_PTS;
178
+
179
+
180
+ LIBDE265_API int de265_get_image_width(const struct de265_image*,int channel);
181
+ LIBDE265_API int de265_get_image_height(const struct de265_image*,int channel);
182
+ LIBDE265_API enum de265_chroma de265_get_chroma_format(const struct de265_image*);
183
+ LIBDE265_API int de265_get_bits_per_pixel(const struct de265_image*,int channel);
184
+ /* The |out_stride| is returned as "bytes per line" if a non-NULL parameter is given. */
185
+ LIBDE265_API const uint8_t* de265_get_image_plane(const struct de265_image*, int channel, int* out_stride);
186
+ LIBDE265_API void* de265_get_image_plane_user_data(const struct de265_image*, int channel);
187
+ LIBDE265_API de265_PTS de265_get_image_PTS(const struct de265_image*);
188
+ LIBDE265_API void* de265_get_image_user_data(const struct de265_image*);
189
+ LIBDE265_API void de265_set_image_user_data(struct de265_image*, void *user_data);
190
+
191
+ /* Get NAL-header information of this frame. You can pass in NULL pointers if you
192
+ do not need this piece of information.
193
+ */
194
+ LIBDE265_API void de265_get_image_NAL_header(const struct de265_image*,
195
+ int* nal_unit_type,
196
+ const char** nal_unit_name, // textual description of 'nal_unit_type'
197
+ int* nuh_layer_id,
198
+ int* nuh_temporal_id);
199
+
200
+ LIBDE265_API int de265_get_image_full_range_flag(const struct de265_image*);
201
+ LIBDE265_API int de265_get_image_colour_primaries(const struct de265_image*);
202
+ LIBDE265_API int de265_get_image_transfer_characteristics(const struct de265_image*);
203
+ LIBDE265_API int de265_get_image_matrix_coefficients(const struct de265_image*);
204
+
205
+
206
+ /* === decoder === */
207
+
208
+ typedef void de265_decoder_context; // private structure
209
+
210
+
211
+
212
+ /* Get a new decoder context. Must be freed with de265_free_decoder(). */
213
+ LIBDE265_API de265_decoder_context* de265_new_decoder(void);
214
+
215
+ /* Initialize background decoding threads. If this function is not called,
216
+ all decoding is done in the main thread (no multi-threading). */
217
+ LIBDE265_API de265_error de265_start_worker_threads(de265_decoder_context*, int number_of_threads);
218
+
219
+ /* Free decoder context. May only be called once on a context. */
220
+ LIBDE265_API de265_error de265_free_decoder(de265_decoder_context*);
221
+
222
+ #ifndef LIBDE265_DISABLE_DEPRECATED
223
+ /* Push more data into the decoder, must be raw h265.
224
+ All complete images in the data will be decoded, hence, do not push
225
+ too much data at once to prevent image buffer overflows.
226
+ The end of a picture can only be detected when the succeeding start-code
227
+ is read from the data.
228
+ If you want to flush the data and force decoding of the data so far
229
+ (e.g. at the end of a file), call de265_decode_data() with 'length' zero.
230
+
231
+ NOTE: This method is deprecated and will be removed in a future version.
232
+ You should use "de265_push_data" or "de265_push_NAL" and "de265_decode"
233
+ instead.
234
+ */
235
+ LIBDE265_API LIBDE265_DEPRECATED de265_error de265_decode_data(de265_decoder_context*, const void* data, int length);
236
+ #endif
237
+
238
+ /* Push more data into the decoder, must be a raw h265 bytestream with startcodes.
239
+ The PTS is assigned to all NALs whose start-code 0x000001 is contained in the data.
240
+ The bytestream must contain all stuffing-bytes.
241
+ This function only pushes data into the decoder, nothing will be decoded.
242
+ */
243
+ LIBDE265_API de265_error de265_push_data(de265_decoder_context*, const void* data, int length,
244
+ de265_PTS pts, void* user_data);
245
+
246
+ /* Indicate that de265_push_data has just received data until the end of a NAL.
247
+ The remaining pending input data is put into a NAL package and forwarded to the decoder.
248
+ */
249
+ LIBDE265_API void de265_push_end_of_NAL(de265_decoder_context*);
250
+
251
+ /* Indicate that de265_push_data has just received data until the end of a frame.
252
+ All data pending at the decoder input will be pushed into the decoder and
253
+ the decoded picture is pushed to the output queue.
254
+ */
255
+ LIBDE265_API void de265_push_end_of_frame(de265_decoder_context*);
256
+
257
+ /* Push a complete NAL unit without startcode into the decoder. The data must still
258
+ contain all stuffing-bytes.
259
+ This function only pushes data into the decoder, nothing will be decoded.
260
+ */
261
+ LIBDE265_API de265_error de265_push_NAL(de265_decoder_context*, const void* data, int length,
262
+ de265_PTS pts, void* user_data);
263
+
264
+ /* Indicate the end-of-stream. All data pending at the decoder input will be
265
+ pushed into the decoder and the decoded picture queue will be completely emptied.
266
+ */
267
+ LIBDE265_API de265_error de265_flush_data(de265_decoder_context*);
268
+
269
+ /* Return number of bytes pending at the decoder input.
270
+ Can be used to avoid overflowing the decoder with too much data.
271
+ */
272
+ LIBDE265_API int de265_get_number_of_input_bytes_pending(de265_decoder_context*);
273
+
274
+ /* Return number of NAL units pending at the decoder input.
275
+ Can be used to avoid overflowing the decoder with too much data.
276
+ */
277
+ LIBDE265_API int de265_get_number_of_NAL_units_pending(de265_decoder_context*);
278
+
279
+ /* Do some decoding. Returns status whether it did perform some decoding or
280
+ why it could not do so. If 'more' is non-null, indicates whether de265_decode()
281
+ should be called again (possibly after resolving the indicated problem).
282
+ DE265_OK - decoding ok
283
+ DE265_ERROR_IMAGE_BUFFER_FULL - DPB full, extract some images before continuing
284
+ DE265_ERROR_WAITING_FOR_INPUT_DATA - insert more data before continuing
285
+
286
+ You have to consider these cases:
287
+ - decoding successful -> err = DE265_OK, more=true
288
+ - decoding stalled -> err != DE265_OK, more=true
289
+ - decoding finished -> err = DE265_OK, more=false
290
+ - unresolvable error -> err != DE265_OK, more=false
291
+ */
292
+ LIBDE265_API de265_error de265_decode(de265_decoder_context*, int* more);
293
+
294
+ /* Clear decoder state. Call this when skipping in the stream.
295
+ */
296
+ LIBDE265_API void de265_reset(de265_decoder_context*);
297
+
298
+ /* Return next decoded picture, if there is any. If no complete picture has been
299
+ decoded yet, NULL is returned. You should call de265_release_next_picture() to
300
+ advance to the next picture. */
301
+ LIBDE265_API const struct de265_image* de265_peek_next_picture(de265_decoder_context*); // may return NULL
302
+
303
+ /* Get next decoded picture and remove this picture from the decoder output queue.
304
+ Returns NULL is there is no decoded picture ready.
305
+ You can use the picture only until you call any other de265_* function. */
306
+ LIBDE265_API const struct de265_image* de265_get_next_picture(de265_decoder_context*); // may return NULL
307
+
308
+ /* Release the current decoded picture for reuse in the decoder. You should not
309
+ use the data anymore after calling this function. */
310
+ LIBDE265_API void de265_release_next_picture(de265_decoder_context*);
311
+
312
+
313
+ LIBDE265_API de265_error de265_get_warning(de265_decoder_context*);
314
+
315
+
316
+ enum de265_image_format {
317
+ de265_image_format_mono8 = 1,
318
+ de265_image_format_YUV420P8 = 2,
319
+ de265_image_format_YUV422P8 = 3,
320
+ de265_image_format_YUV444P8 = 4
321
+ };
322
+
323
+ struct de265_image_spec
324
+ {
325
+ enum de265_image_format format;
326
+ int width;
327
+ int height;
328
+ int alignment;
329
+
330
+ // conformance window
331
+
332
+ int crop_left;
333
+ int crop_right;
334
+ int crop_top;
335
+ int crop_bottom;
336
+
337
+ int visible_width; // convenience, width - crop_left - crop_right
338
+ int visible_height; // convenience, height - crop_top - crop_bottom
339
+ };
340
+
341
+ struct de265_image_allocation
342
+ {
343
+ int (*get_buffer)(de265_decoder_context* ctx, // first parameter deprecated
344
+ struct de265_image_spec* spec,
345
+ struct de265_image* img,
346
+ void* userdata);
347
+ void (*release_buffer)(de265_decoder_context* ctx, // first parameter deprecated
348
+ struct de265_image* img,
349
+ void* userdata);
350
+ };
351
+
352
+ /* The user data pointer will be given to the get_buffer() and release_buffer() functions
353
+ in de265_image_allocation. */
354
+ LIBDE265_API void de265_set_image_allocation_functions(de265_decoder_context*,
355
+ struct de265_image_allocation*,
356
+ void* userdata);
357
+ LIBDE265_API const struct de265_image_allocation *de265_get_default_image_allocation_functions(void);
358
+
359
+ LIBDE265_API void de265_set_image_plane(struct de265_image* img, int cIdx, void* mem, int stride, void *userdata);
360
+
361
+
362
+ /* --- frame dropping API ---
363
+
364
+ To limit decoding to a maximum temporal layer (TID), use de265_set_limit_TID().
365
+ The maximum layer ID in the stream can be queried with de265_get_highest_TID().
366
+ Note that the maximum layer ID can change throughout the stream.
367
+
368
+ For a fine-grained selection of the frame-rate, use de265_set_framerate_ratio().
369
+ A percentage of 100% will decode all frames in all temporal layers. A lower percentage
370
+ will drop approximately as many frames. Note that this only accurate if the frames
371
+ are distributed evenly among the layers. Otherwise, the mapping is non-linear.
372
+
373
+ The limit_TID has a higher precedence than framerate_ratio. Hence, setting a higher
374
+ framerate-ratio will decode at limit_TID without dropping.
375
+
376
+ With change_framerate(), the output frame-rate can be increased/decreased to some
377
+ discrete preferable values. Currently, these are non-dropped decoding at various
378
+ TID layers.
379
+ */
380
+
381
+ LIBDE265_API int de265_get_highest_TID(de265_decoder_context*); // highest temporal substream to decode
382
+ LIBDE265_API int de265_get_current_TID(de265_decoder_context*); // currently decoded temporal substream
383
+
384
+ LIBDE265_API void de265_set_limit_TID(de265_decoder_context*,int max_tid); // highest temporal substream to decode
385
+ LIBDE265_API void de265_set_framerate_ratio(de265_decoder_context*,int percent); // percentage of frames to decode (approx)
386
+ LIBDE265_API int de265_change_framerate(de265_decoder_context*,int more_vs_less); // 1: more, -1: less, returns corresponding framerate_ratio
387
+
388
+
389
+ /* --- decoding parameters --- */
390
+
391
+ enum de265_param {
392
+ DE265_DECODER_PARAM_BOOL_SEI_CHECK_HASH=0, // (bool) Perform SEI hash check on decoded pictures.
393
+ DE265_DECODER_PARAM_DUMP_SPS_HEADERS=1, // (int) Dump headers to specified file-descriptor.
394
+ DE265_DECODER_PARAM_DUMP_VPS_HEADERS=2,
395
+ DE265_DECODER_PARAM_DUMP_PPS_HEADERS=3,
396
+ DE265_DECODER_PARAM_DUMP_SLICE_HEADERS=4,
397
+ DE265_DECODER_PARAM_ACCELERATION_CODE=5, // (int) enum de265_acceleration, default: AUTO
398
+ DE265_DECODER_PARAM_SUPPRESS_FAULTY_PICTURES=6, // (bool) do not output frames with decoding errors, default: no (output all images)
399
+
400
+ DE265_DECODER_PARAM_DISABLE_DEBLOCKING=7, // (bool) disable deblocking
401
+ DE265_DECODER_PARAM_DISABLE_SAO=8 // (bool) disable SAO filter
402
+ //DE265_DECODER_PARAM_DISABLE_MC_RESIDUAL_IDCT=9, // (bool) disable decoding of IDCT residuals in MC blocks
403
+ //DE265_DECODER_PARAM_DISABLE_INTRA_RESIDUAL_IDCT=10 // (bool) disable decoding of IDCT residuals in MC blocks
404
+ };
405
+
406
+ // sorted such that a large ID includes all optimizations from lower IDs
407
+ enum de265_acceleration {
408
+ de265_acceleration_SCALAR = 0, // only fallback implementation
409
+ de265_acceleration_MMX = 10,
410
+ de265_acceleration_SSE = 20,
411
+ de265_acceleration_SSE2 = 30,
412
+ de265_acceleration_SSE4 = 40,
413
+ de265_acceleration_AVX = 50, // not implemented yet
414
+ de265_acceleration_AVX2 = 60, // not implemented yet
415
+ de265_acceleration_ARM = 70,
416
+ de265_acceleration_NEON = 80,
417
+ de265_acceleration_AUTO = 10000
418
+ };
419
+
420
+
421
+ /* Set decoding parameters. */
422
+ LIBDE265_API void de265_set_parameter_bool(de265_decoder_context*, enum de265_param param, int value);
423
+
424
+ LIBDE265_API void de265_set_parameter_int(de265_decoder_context*, enum de265_param param, int value);
425
+
426
+ /* Get decoding parameters. */
427
+ LIBDE265_API int de265_get_parameter_bool(de265_decoder_context*, enum de265_param param);
428
+
429
+
430
+
431
+ /* --- optional library initialization --- */
432
+
433
+ /* Static library initialization. Must be paired with de265_free().
434
+ Initialization is optional, since it will be done implicitly in de265_new_decoder().
435
+ Return value is false if initialization failed.
436
+ Only call de265_free() when initialization was successful.
437
+ Multiple calls to 'init' are allowed, but must be matched with an equal number of 'free' calls.
438
+ */
439
+ LIBDE265_API de265_error de265_init(void);
440
+
441
+ /* Free global library data.
442
+ An implicit free call is made in de265_free_decoder().
443
+ Returns false if library was not initialized before, or if 'free' was called
444
+ more often than 'init'.
445
+ */
446
+ LIBDE265_API de265_error de265_free(void);
447
+
448
+
449
+ #ifdef __cplusplus
450
+ }
451
+ #endif
452
+
453
+ #endif