Lines Matching full:encoder
50 * encoder.
53 * \link flac_stream_encoder stream encoder \endlink module.
56 /** \defgroup flac_encoder FLAC/ \*_encoder.h: encoder interfaces
60 * This module describes the encoder layers provided by libFLAC.
62 * The stream encoder can be used to encode complete streams either to the
66 * If the client also supplies a seek callback, the encoder will also
72 * \link flac_stream_encoder stream encoder \endlink module.
75 /** \defgroup flac_stream_encoder FLAC/stream_encoder.h: stream encoder interface
80 * encoder.
82 * The stream encoder can encode to native FLAC, and optionally Ogg FLAC
85 * The basic usage of this encoder is as follows:
86 * - The program creates an instance of an encoder using
112 * subsequently calls the callbacks when there is encoder data ready
115 * which causes the encoder to encode any data still in its input pipe,
117 * seeking is possible, and finally reset the encoder to the
122 * In more detail, the stream encoder functions similarly to the
129 * Unlike the decoders, the stream encoder has many options that can
143 * setting up the encoder to encode FLAC data to the client via
150 * encoder to go back after encoding is finished to write back
156 * filename or open \c FILE*; the encoder will handle all the callbacks
171 * encoder in one of two ways:
175 * the encoder, each of the same length. The samples need not be
191 * FLAC__stream_encoder_finish(), which causes the encoder to encode any
199 * the encoder to write a PADDING block of the correct size, so that
213 * after the first encoding pass, the encoder will try to seek back to the
219 * The "set" functions may only be called when the encoder is in the
235 * The encoder's state can be obtained by calling FLAC__stream_encoder_get_state().
237 * If the encoder gets into any other state besides \c FLAC__STREAM_ENCODER_OK
244 /**< The encoder is in the normal OK state and samples can be processed. */
247 /**< The encoder is in the uninitialized state; one of the
299 /**< General failure to set up encoder; call FLAC__stream_encoder_get_state() for cause. */
310 /**< The encoder has an invalid setting for number of channels. */
313 /**< The encoder has an invalid setting for bits-per-sample.
314 * FLAC supports 4-32 bps but the reference encoder currently supports
319 /**< The encoder has an invalid setting for the input sample rate. */
322 /**< The encoder has an invalid setting for the block size. */
325 /**< The encoder has an invalid setting for the maximum LPC order. */
328 /**< The encoder has an invalid setting for the precision of the quantized linear predictor coefficients. */
334 /**< The encoder is bound to the <A HREF="../format.html#subset">Subset</A> but other settings violate it. */
337 /**< The metadata input to the encoder is invalid, in one of the following ways:
346 /**< FLAC__stream_encoder_init_*() was called when the encoder was
395 /**< An unrecoverable error occurred. The encoder will return from the process call. */
461 /** The opaque structure definition for the stream encoder type.
462 * See the \link flac_stream_encoder stream encoder module \endlink
474 * The supplied function will be called when the encoder needs to read back
475 * encoded data. This happens during the metadata callback, when the encoder
485 * FLAC__StreamEncoderReadStatus read_cb(const FLAC__StreamEncoder *encoder, FLAC__byte buffer[], size_t *bytes, void *client_data)
503 * state should not be called on the \a encoder while in the callback.
505 * \param encoder The encoder instance calling the callback.
519 typedef FLAC__StreamEncoderReadStatus (*FLAC__StreamEncoderReadCallback)(const FLAC__StreamEncoder *encoder, FLAC__byte buffer[], size_t *bytes, void *client_data);
525 * by the encoder anytime there is raw encoded data ready to write. It may
544 * state should not be called on the \a encoder while in the callback.
546 * \param encoder The encoder instance calling the callback.
557 typedef FLAC__StreamEncoderWriteStatus (*FLAC__StreamEncoderWriteCallback)(const FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, void *client_data);
563 * when the encoder needs to seek the output stream. The encoder will pass
568 * FLAC__StreamEncoderSeekStatus seek_cb(const FLAC__StreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_data)
581 * state should not be called on the \a encoder while in the callback.
583 * \param encoder The encoder instance calling the callback.
591 typedef FLAC__StreamEncoderSeekStatus (*FLAC__StreamEncoderSeekCallback)(const FLAC__StreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_data);
597 * when the encoder needs to know the current position of the output stream.
601 * which the encoder is writing. If you are buffering the output, make
605 * can use lseek(fd, SEEK_CUR, 0). The encoder may later seek back to
610 * FLAC__StreamEncoderTellStatus tell_cb(const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client_data)
626 * state should not be called on the \a encoder while in the callback.
628 * \param encoder The encoder instance calling the callback.
636 typedef FLAC__StreamEncoderTellStatus (*FLAC__StreamEncoderTellCallback)(const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client_data);
648 * state should not be called on the \a encoder while in the callback.
650 * \param encoder The encoder instance calling the callback.
655 typedef void (*FLAC__StreamEncoderMetadataCallback)(const FLAC__StreamEncoder *encoder, const FLAC__StreamMetadata *metadata, void *client_data);
661 * The supplied function will be called when the encoder has finished
667 * state should not be called on the \a encoder while in the callback.
669 * \param encoder The encoder instance calling the callback.
678 typedef void (*FLAC__StreamEncoderProgressCallback)(const FLAC__StreamEncoder *encoder, FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned frames_written, unsigned total_frames_estimate, void *client_data);
687 /** Create a new stream encoder instance. The instance is created with
696 /** Free an encoder instance. Deletes the object pointed to by \a encoder.
698 * \param encoder A pointer to an existing encoder.
700 * \code encoder != NULL \endcode
702 FLAC_API void FLAC__stream_encoder_delete(FLAC__StreamEncoder *encoder);
721 * \param encoder An encoder instance to set.
724 * \code encoder != NULL \endcode
726 * \c false if the encoder is already initialized, else \c true.
728 FLAC_API FLAC__bool FLAC__stream_encoder_set_ogg_serial_number(FLAC__StreamEncoder *encoder, long serial_number);
730 /** Set the "verify" flag. If \c true, the encoder will verify it's own
737 * \param encoder An encoder instance to set.
740 * \code encoder != NULL \endcode
742 * \c false if the encoder is already initialized, else \c true.
744 FLAC_API FLAC__bool FLAC__stream_encoder_set_verify(FLAC__StreamEncoder *encoder, FLAC__bool value);
747 * the encoder will comply with the Subset and will check the
755 * \param encoder An encoder
758 * \code encoder != NULL \endcode
760 * \c false if the encoder is already initialized, else \c true.
762 FLAC_API FLAC__bool FLAC__stream_encoder_set_streamable_subset(FLAC__StreamEncoder *encoder, FLAC__bool value);
767 * \param encoder An encoder instance to set.
770 * \code encoder != NULL \endcode
772 * \c false if the encoder is already initialized, else \c true.
774 FLAC_API FLAC__bool FLAC__stream_encoder_set_channels(FLAC__StreamEncoder *encoder, unsigned value);
779 * Do not feed the encoder data that is wider than the value you
783 * \param encoder An encoder instance to set.
786 * \code encoder != NULL \endcode
788 * \c false if the encoder is already initialized, else \c true.
790 FLAC_API FLAC__bool FLAC__stream_encoder_set_bits_per_sample(FLAC__StreamEncoder *encoder, unsigned value);
795 * \param encoder An encoder instance to set.
798 * \code encoder != NULL \endcode
800 * \c false if the encoder is already initialized, else \c true.
802 FLAC_API FLAC__bool FLAC__stream_encoder_set_sample_rate(FLAC__StreamEncoder *encoder, unsigned value);
807 * the encoder expends to compress the file. A higher level usually
858 * \param encoder An encoder instance to set.
861 * \code encoder != NULL \endcode
863 * \c false if the encoder is already initialized, else \c true.
865 FLAC_API FLAC__bool FLAC__stream_encoder_set_compression_level(FLAC__StreamEncoder *encoder, unsigned value);
869 * The number of samples to use per frame. Use \c 0 to let the encoder
873 * \param encoder An encoder instance to set.
876 * \code encoder != NULL \endcode
878 * \c false if the encoder is already initialized, else \c true.
880 FLAC_API FLAC__bool FLAC__stream_encoder_set_blocksize(FLAC__StreamEncoder *encoder, unsigned value);
887 * \param encoder An encoder instance to set.
890 * \code encoder != NULL \endcode
892 * \c false if the encoder is already initialized, else \c true.
894 FLAC_API FLAC__bool FLAC__stream_encoder_set_do_mid_side_stereo(FLAC__StreamEncoder *encoder, FLAC__bool value);
903 * \param encoder An encoder instance to set.
906 * \code encoder != NULL \endcode
908 * \c false if the encoder is already initialized, else \c true.
910 FLAC_API FLAC__bool FLAC__stream_encoder_set_loose_mid_side_stereo(FLAC__StreamEncoder *encoder, FLAC__bool value);
912 /** Sets the apodization function(s) the encoder will use when windowing
956 * is empty the encoder defaults to \c "tukey(0.5)".
959 * encoder will try each of them separately and choose the window that
962 * Note that each function specified causes the encoder to occupy a
968 * \param encoder An encoder instance to set.
971 * \code encoder != NULL \endcode
974 * \c false if the encoder is already initialized, else \c true.
976 FLAC_API FLAC__bool FLAC__stream_encoder_set_apodization(FLAC__StreamEncoder *encoder, const char *specification);
981 * \param encoder An encoder instance to set.
984 * \code encoder != NULL \endcode
986 * \c false if the encoder is already initialized, else \c true.
988 FLAC_API FLAC__bool FLAC__stream_encoder_set_max_lpc_order(FLAC__StreamEncoder *encoder, unsigned value);
991 * coefficients, or \c 0 to let the encoder select it based on the
999 * \param encoder An encoder instance to set.
1002 * \code encoder != NULL \endcode
1004 * \c false if the encoder is already initialized, else \c true.
1006 FLAC_API FLAC__bool FLAC__stream_encoder_set_qlp_coeff_precision(FLAC__StreamEncoder *encoder, unsigned value);
1013 * \param encoder An encoder instance to set.
1016 * \code encoder != NULL \endcode
1018 * \c false if the encoder is already initialized, else \c true.
1020 FLAC_API FLAC__bool FLAC__stream_encoder_set_do_qlp_coeff_prec_search(FLAC__StreamEncoder *encoder, FLAC__bool value);
1025 * \param encoder An encoder instance to set.
1028 * \code encoder != NULL \endcode
1030 * \c false if the encoder is already initialized, else \c true.
1032 FLAC_API FLAC__bool FLAC__stream_encoder_set_do_escape_coding(FLAC__StreamEncoder *encoder, FLAC__bool value);
1034 /** Set to \c false to let the encoder estimate the best model order
1036 * encoder to evaluate all order models and select the best.
1039 * \param encoder An encoder instance to set.
1042 * \code encoder != NULL \endcode
1044 * \c false if the encoder is already initialized, else \c true.
1046 FLAC_API FLAC__bool FLAC__stream_encoder_set_do_exhaustive_model_search(FLAC__StreamEncoder *encoder, FLAC__bool value);
1057 * Otherwise, set a min and max order, and the encoder will search
1062 * \param encoder An encoder instance to set.
1065 * \code encoder != NULL \endcode
1067 * \c false if the encoder is already initialized, else \c true.
1069 FLAC_API FLAC__bool FLAC__stream_encoder_set_min_residual_partition_order(FLAC__StreamEncoder *encoder, unsigned value);
1080 * Otherwise, set a min and max order, and the encoder will search
1085 * \param encoder An encoder instance to set.
1088 * \code encoder != NULL \endcode
1090 * \c false if the encoder is already initialized, else \c true.
1092 FLAC_API FLAC__bool FLAC__stream_encoder_set_max_residual_partition_order(FLAC__StreamEncoder *encoder, unsigned value);
1097 * \param encoder An encoder instance to set.
1100 * \code encoder != NULL \endcode
1102 * \c false if the encoder is already initialized, else \c true.
1104 FLAC_API FLAC__bool FLAC__stream_encoder_set_rice_parameter_search_dist(FLAC__StreamEncoder *encoder, unsigned value);
1113 * \param encoder An encoder instance to set.
1116 * \code encoder != NULL \endcode
1118 * \c false if the encoder is already initialized, else \c true.
1120 FLAC_API FLAC__bool FLAC__stream_encoder_set_total_samples_estimate(FLAC__StreamEncoder *encoder, FLAC__uint64 value);
1125 * the encoder may need to change the \a is_last flag inside them, and
1126 * in some cases update seek point offsets. Otherwise, the encoder will
1131 * The encoder stores only copies of the pointers in the \a metadata array;
1140 * By default the encoder does not create a SEEKTABLE. If one is supplied
1157 * then while it is encoding the encoder will fill the stream offsets in
1166 * The encoder instance \b will modify the first \c SEEKTABLE block
1180 * the second metadata block of the stream. The encoder already supplies
1182 * VORBIS_COMMENT block, the encoder will supply that too. Otherwise, if
1193 * \param encoder An encoder instance to set.
1197 * \code encoder != NULL \endcode
1199 * \c false if the encoder is already initialized, else \c true.
1200 * \c false if the encoder is already initialized, or if
1203 FLAC_API FLAC__bool FLAC__stream_encoder_set_metadata(FLAC__StreamEncoder *encoder, FLAC__StreamMetadata **metadata, unsigned num_blocks);
1205 /** Get the current encoder state.
1207 * \param encoder An encoder instance to query.
1209 * \code encoder != NULL \endcode
1211 * The current encoder state.
1213 FLAC_API FLAC__StreamEncoderState FLAC__stream_encoder_get_state(const FLAC__StreamEncoder *encoder);
1216 * Useful when the stream encoder state is
1219 * \param encoder An encoder instance to query.
1221 * \code encoder != NULL \endcode
1225 FLAC_API FLAC__StreamDecoderState FLAC__stream_encoder_get_verify_decoder_state(const FLAC__StreamEncoder *encoder);
1227 /** Get the current encoder state as a C string.
1232 * \param encoder A encoder instance to query.
1234 * \code encoder != NULL \endcode
1236 * The encoder state as a C string. Do not modify the contents.
1238 FLAC_API const char *FLAC__stream_encoder_get_resolved_state_string(const FLAC__StreamEncoder *encoder);
1241 * Useful when the stream encoder state is
1246 * \param encoder An encoder instance to query.
1255 * \code encoder != NULL \endcode
1257 FLAC_API void FLAC__stream_encoder_get_verify_decoder_error_stats(const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_sample, unsigned *frame_number, unsigned *channel, unsigned *sample, FLAC__int32 *expected, FLAC__int32 *got);
1261 * \param encoder An encoder instance to query.
1263 * \code encoder != NULL \endcode
1267 FLAC_API FLAC__bool FLAC__stream_encoder_get_verify(const FLAC__StreamEncoder *encoder);
1271 * \param encoder An encoder instance to query.
1273 * \code encoder != NULL \endcode
1277 FLAC_API FLAC__bool FLAC__stream_encoder_get_streamable_subset(const FLAC__StreamEncoder *encoder);
1281 * \param encoder An encoder instance to query.
1283 * \code encoder != NULL \endcode
1287 FLAC_API unsigned FLAC__stream_encoder_get_channels(const FLAC__StreamEncoder *encoder);
1291 * \param encoder An encoder instance to query.
1293 * \code encoder != NULL \endcode
1297 FLAC_API unsigned FLAC__stream_encoder_get_bits_per_sample(const FLAC__StreamEncoder *encoder);
1301 * \param encoder An encoder instance to query.
1303 * \code encoder != NULL \endcode
1307 FLAC_API unsigned FLAC__stream_encoder_get_sample_rate(const FLAC__StreamEncoder *encoder);
1311 * \param encoder An encoder instance to query.
1313 * \code encoder != NULL \endcode
1317 FLAC_API unsigned FLAC__stream_encoder_get_blocksize(const FLAC__StreamEncoder *encoder);
1321 * \param encoder An encoder instance to query.
1323 * \code encoder != NULL \endcode
1327 FLAC_API FLAC__bool FLAC__stream_encoder_get_do_mid_side_stereo(const FLAC__StreamEncoder *encoder);
1331 * \param encoder An encoder instance to query.
1333 * \code encoder != NULL \endcode
1337 FLAC_API FLAC__bool FLAC__stream_encoder_get_loose_mid_side_stereo(const FLAC__StreamEncoder *encoder);
1341 * \param encoder An encoder instance to query.
1343 * \code encoder != NULL \endcode
1347 FLAC_API unsigned FLAC__stream_encoder_get_max_lpc_order(const FLAC__StreamEncoder *encoder);
1351 * \param encoder An encoder instance to query.
1353 * \code encoder != NULL \endcode
1357 FLAC_API unsigned FLAC__stream_encoder_get_qlp_coeff_precision(const FLAC__StreamEncoder *encoder);
1361 * \param encoder An encoder instance to query.
1363 * \code encoder != NULL \endcode
1367 FLAC_API FLAC__bool FLAC__stream_encoder_get_do_qlp_coeff_prec_search(const FLAC__StreamEncoder *encoder);
1371 * \param encoder An encoder instance to query.
1373 * \code encoder != NULL \endcode
1377 FLAC_API FLAC__bool FLAC__stream_encoder_get_do_escape_coding(const FLAC__StreamEncoder *encoder);
1381 * \param encoder An encoder instance to query.
1383 * \code encoder != NULL \endcode
1387 FLAC_API FLAC__bool FLAC__stream_encoder_get_do_exhaustive_model_search(const FLAC__StreamEncoder *encoder);
1391 * \param encoder An encoder instance to query.
1393 * \code encoder != NULL \endcode
1397 FLAC_API unsigned FLAC__stream_encoder_get_min_residual_partition_order(const FLAC__StreamEncoder *encoder);
1401 * \param encoder An encoder instance to query.
1403 * \code encoder != NULL \endcode
1407 FLAC_API unsigned FLAC__stream_encoder_get_max_residual_partition_order(const FLAC__StreamEncoder *encoder);
1411 * \param encoder An encoder instance to query.
1413 * \code encoder != NULL \endcode
1417 FLAC_API unsigned FLAC__stream_encoder_get_rice_parameter_search_dist(const FLAC__StreamEncoder *encoder);
1420 * The encoder merely mimics back the value given to
1424 * \param encoder An encoder instance to set.
1426 * \code encoder != NULL \endcode
1430 FLAC_API FLAC__uint64 FLAC__stream_encoder_get_total_samples_estimate(const FLAC__StreamEncoder *encoder);
1432 /** Initialize the encoder instance to encode native FLAC streams.
1434 * This flavor of initialization sets up the encoder to encode to a
1449 * \param encoder An uninitialized encoder instance.
1454 * supported. The encoder uses seeking to go back
1463 * less efficient for the encoder.
1473 * less efficient for the encoder.
1477 * this function is not necessary as the encoder
1488 * \code encoder != NULL \endcode
1493 FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_stream(FLAC__StreamEncoder *encoder
1495 /** Initialize the encoder instance to encode Ogg FLAC streams.
1497 * This flavor of initialization sets up the encoder to encode to a FLAC
1512 * \param encoder An uninitialized encoder instance.
1522 * supported. The encoder uses seeking to go back
1531 * less efficient for the encoder.
1541 * less efficient for the encoder.
1545 * this function is not necessary as the encoder
1556 * \code encoder != NULL \endcode
1561 FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_ogg_stream(FLAC__StreamEncoder *encoder, FLAC__StreamEncoderReadCallback read_callback, FLAC__StreamEncoderWriteCallback write_callback, FLAC__StreamEncoderSeekCallback seek_callback, FLAC__StreamEncoderTellCallback tell_callback, FLAC__StreamEncoderMetadataCallback metadata_callback, void *client_data);
1563 /** Initialize the encoder instance to encode native FLAC files.
1565 * This flavor of initialization sets up the encoder to encode to a
1574 * \param encoder An uninitialized encoder instance.
1577 * becomes owned by the encoder and should not be
1590 * \code encoder != NULL \endcode
1596 FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_FILE(FLAC__StreamEncoder *encoder, FILE *file, FLAC__StreamEncoderProgressCallback progress_callback, void *client_data);
1598 /** Initialize the encoder instance to encode Ogg FLAC files.
1600 * This flavor of initialization sets up the encoder to encode to a
1609 * \param encoder An uninitialized encoder instance.
1612 * becomes owned by the encoder and should not be
1625 * \code encoder != NULL \endcode
1631 FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_ogg_FILE(FLAC__StreamEncoder *encoder, FILE *file, FLAC__StreamEncoderProgressCallback progress_callback, void *client_data);
1633 /** Initialize the encoder instance to encode native FLAC files.
1635 * This flavor of initialization sets up the encoder to encode to a plain
1646 * \param encoder An uninitialized encoder instance.
1658 * \code encoder != NULL \endcode
1663 FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_file(FLAC__StreamEncoder *encoder, const char *filename, FLAC__StreamEncoderProgressCallback progress_callback, void *client_data);
1665 /** Initialize the encoder instance to encode Ogg FLAC files.
1667 * This flavor of initialization sets up the encoder to encode to a plain
1678 * \param encoder An uninitialized encoder instance.
1690 * \code encoder != NULL \endcode
1695 FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_ogg_file(FLAC__StreamEncoder *encoder, const char *filename, FLAC__StreamEncoderProgressCallback progress_callback, void *client_data);
1698 * Flushes the encoding buffer, releases resources, resets the encoder
1699 * settings to their defaults, and returns the encoder state to
1713 * \param encoder An uninitialized encoder instance.
1715 * \code encoder != NULL \endcode
1723 FLAC_API FLAC__bool FLAC__stream_encoder_finish(FLAC__StreamEncoder *encoder);
1739 * \param encoder An initialized encoder instance in the OK state.
1743 * \code encoder != NULL \endcode
1744 * \code FLAC__stream_encoder_get_state(encoder) == FLAC__STREAM_ENCODER_OK \endcode
1747 * encoder state with FLAC__stream_encoder_get_state() to see what
1750 FLAC_API FLAC__bool FLAC__stream_encoder_process(FLAC__StreamEncoder *encoder, const FLAC__int32 * const buffer[], unsigned samples);
1768 * \param encoder An initialized encoder instance in the OK state.
1775 encoder != NULL \endcode
1776 * \code FLAC__stream_encoder_get_state(encoder) == FLAC__STREAM_ENCODER_OK \endcode
1779 * encoder state with FLAC__stream_encoder_get_state() to see what
1782 FLAC_API FLAC__bool FLAC__stream_encoder_process_interleaved(FLAC__StreamEncoder *encoder, const FLAC__int32 buffer[], unsigned samples);