FFmpeg
|
#include <stdio.h>
#include <stdlib.h>
#include <zlib.h>
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "encode.h"
#include "put_bits.h"
#include "bytestream.h"
#include "zlib_wrapper.h"
Go to the source code of this file.
Data Structures | |
struct | Block |
struct | Palette |
struct | FlashSV2Context |
Macros | |
#define | HAS_IFRAME_IMAGE 0x02 |
#define | HAS_PALLET_INFO 0x01 |
#define | COLORSPACE_BGR 0x00 |
#define | COLORSPACE_15_7 0x10 |
#define | HAS_DIFF_BLOCKS 0x04 |
#define | ZLIB_PRIME_COMPRESS_CURRENT 0x02 |
#define | ZLIB_PRIME_COMPRESS_PREVIOUS 0x01 |
#define | FLASHSV2_DUMB |
#define | ABSDIFF(a, b) (abs((int)(a)-(int)(b))) |
Functions | |
static av_cold void | cleanup (FlashSV2Context *s) |
static void | init_blocks (FlashSV2Context *s, Block *blocks, uint8_t *encbuf, uint8_t *databuf) |
static void | reset_stats (FlashSV2Context *s) |
static int | update_block_dimensions (FlashSV2Context *s, int block_width, int block_height) |
static av_cold int | flashsv2_encode_init (AVCodecContext *avctx) |
static int | new_key_frame (FlashSV2Context *s) |
static int | write_palette (FlashSV2Context *s, uint8_t *buf, int buf_size) |
static int | write_header (FlashSV2Context *s, uint8_t *buf, int buf_size) |
static int | write_block (Block *b, uint8_t *buf, int buf_size) |
static int | encode_zlib (Block *b, uint8_t *buf, unsigned long *buf_size, z_stream *zstream) |
static int | encode_zlibprime (Block *b, Block *prime, uint8_t *buf, int *buf_size, z_stream *zstream) |
static int | encode_bgr (Block *b, const uint8_t *src, int stride) |
static unsigned | pixel_color15 (const uint8_t *src) |
static unsigned int | chroma_diff (unsigned int c1, unsigned int c2) |
static int | pixel_color7_fast (Palette *palette, unsigned c15) |
static int | pixel_color7_slow (Palette *palette, unsigned color) |
static unsigned | pixel_bgr (const uint8_t *src) |
static int | write_pixel_15_7 (Palette *palette, uint8_t *dest, const uint8_t *src, int dist) |
static int | update_palette_index (Palette *palette) |
static int | generate_default_palette (Palette *palette) |
static int | generate_optimum_palette (Palette *palette, const uint8_t *image, int width, int height, int stride) |
static int | encode_15_7_sl (Palette *palette, uint8_t *dest, const uint8_t *src, int width, int dist) |
static int | encode_15_7 (Palette *palette, Block *b, const uint8_t *src, int stride, int dist) |
static int | encode_block (FlashSV2Context *s, Palette *palette, Block *b, Block *prev, const uint8_t *src, int stride, int dist, int keyframe) |
static int | compare_sl (FlashSV2Context *s, Block *b, const uint8_t *src, uint8_t *frame, uint8_t *key, int y, int keyframe) |
static int | mark_all_blocks (FlashSV2Context *s, const uint8_t *src, int stride, int keyframe) |
static int | encode_all_blocks (FlashSV2Context *s, int keyframe) |
static int | write_all_blocks (FlashSV2Context *s, uint8_t *buf, int buf_size) |
static int | write_bitstream (FlashSV2Context *s, const uint8_t *src, int stride, uint8_t *buf, int buf_size, int keyframe) |
static void | recommend_keyframe (FlashSV2Context *s, int *keyframe) |
static int | optimum_block_width (FlashSV2Context *s) |
static int | optimum_block_height (FlashSV2Context *s) |
static int | optimum_use15_7 (FlashSV2Context *s) |
static int | optimum_dist (FlashSV2Context *s) |
static int | reconfigure_at_keyframe (FlashSV2Context *s, const uint8_t *image, int stride) |
static int | flashsv2_encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *p, int *got_packet) |
static av_cold int | flashsv2_encode_end (AVCodecContext *avctx) |
Variables | |
static const unsigned int | default_screen_video_v2_palette [128] |
const FFCodec | ff_flashsv2_encoder |
Flash Screen Video Version 2 encoder
Definition in file flashsv2enc.c.
#define HAS_IFRAME_IMAGE 0x02 |
Definition at line 57 of file flashsv2enc.c.
#define HAS_PALLET_INFO 0x01 |
Definition at line 58 of file flashsv2enc.c.
#define COLORSPACE_BGR 0x00 |
Definition at line 60 of file flashsv2enc.c.
#define COLORSPACE_15_7 0x10 |
Definition at line 61 of file flashsv2enc.c.
#define HAS_DIFF_BLOCKS 0x04 |
Definition at line 62 of file flashsv2enc.c.
#define ZLIB_PRIME_COMPRESS_CURRENT 0x02 |
Definition at line 63 of file flashsv2enc.c.
#define ZLIB_PRIME_COMPRESS_PREVIOUS 0x01 |
Definition at line 64 of file flashsv2enc.c.
#define FLASHSV2_DUMB |
Definition at line 68 of file flashsv2enc.c.
|
static |
Definition at line 130 of file flashsv2enc.c.
Referenced by copy_av_subtitle(), decode_audio_frame(), encode_audio_frame(), ff_imf_parse_cpl_from_xml_dom(), ff_init_filters(), ff_mov_generate_squashed_ttml_packet(), flashsv2_encode_end(), ftp_delete(), ftp_move(), icecast_open(), libsmbc_delete(), libsmbc_move(), libssh_delete(), libssh_move(), main(), mov_read_kind(), mov_write_ttml_document_from_queue(), open_input(), open_output_file(), open_track_resource_context(), parse_manifest(), read_decode_convert_and_store(), test_asset_map_parsing(), and tls_read().
|
static |
Definition at line 144 of file flashsv2enc.c.
Referenced by update_block_dimensions().
|
static |
Definition at line 171 of file flashsv2enc.c.
Referenced by flashsv2_encode_init(), and reconfigure_at_keyframe().
|
static |
Definition at line 182 of file flashsv2enc.c.
Referenced by flashsv2_encode_init(), and reconfigure_at_keyframe().
|
static |
Definition at line 209 of file flashsv2enc.c.
|
static |
Definition at line 272 of file flashsv2enc.c.
Referenced by flashsv2_encode_frame().
|
static |
Definition at line 289 of file flashsv2enc.c.
Referenced by write_header().
|
static |
Definition at line 295 of file flashsv2enc.c.
Referenced by write_bitstream().
Definition at line 325 of file flashsv2enc.c.
Referenced by write_all_blocks().
|
static |
Definition at line 365 of file flashsv2enc.c.
Referenced by encode_block().
|
static |
Definition at line 383 of file flashsv2enc.c.
Referenced by encode_block().
Definition at line 411 of file flashsv2enc.c.
Referenced by encode_block().
|
inlinestatic |
Definition at line 427 of file flashsv2enc.c.
Referenced by write_pixel_15_7().
Definition at line 432 of file flashsv2enc.c.
Referenced by pixel_color7_slow(), and write_pixel_15_7().
Definition at line 444 of file flashsv2enc.c.
Referenced by write_pixel_15_7().
Definition at line 449 of file flashsv2enc.c.
Referenced by update_palette_index().
|
inlinestatic |
Definition at line 464 of file flashsv2enc.c.
Referenced by write_pixel_15_7().
|
static |
Definition at line 469 of file flashsv2enc.c.
Referenced by encode_15_7_sl().
Definition at line 487 of file flashsv2enc.c.
Referenced by generate_default_palette().
Definition at line 530 of file flashsv2enc.c.
Referenced by reconfigure_at_keyframe().
|
static |
Definition at line 538 of file flashsv2enc.c.
Referenced by reconfigure_at_keyframe().
|
inlinestatic |
Definition at line 545 of file flashsv2enc.c.
Referenced by encode_15_7().
|
static |
Definition at line 555 of file flashsv2enc.c.
Referenced by encode_block().
|
static |
Definition at line 572 of file flashsv2enc.c.
Referenced by encode_all_blocks().
|
static |
Definition at line 609 of file flashsv2enc.c.
Referenced by mark_all_blocks().
|
static |
Definition at line 627 of file flashsv2enc.c.
Referenced by write_bitstream().
|
static |
Definition at line 648 of file flashsv2enc.c.
Referenced by write_bitstream().
|
static |
Definition at line 689 of file flashsv2enc.c.
Referenced by write_bitstream().
|
static |
Definition at line 707 of file flashsv2enc.c.
Referenced by flashsv2_encode_frame().
|
static |
Definition at line 736 of file flashsv2enc.c.
Referenced by flashsv2_encode_frame().
|
static |
Definition at line 762 of file flashsv2enc.c.
Referenced by reconfigure_at_keyframe().
|
static |
Definition at line 774 of file flashsv2enc.c.
Referenced by reconfigure_at_keyframe().
|
static |
Definition at line 786 of file flashsv2enc.c.
Referenced by reconfigure_at_keyframe().
|
static |
Definition at line 801 of file flashsv2enc.c.
Referenced by flashsv2_encode_frame().
|
static |
Definition at line 816 of file flashsv2enc.c.
Referenced by flashsv2_encode_frame().
|
static |
Definition at line 853 of file flashsv2enc.c.
|
static |
Definition at line 904 of file flashsv2enc.c.
|
static |
Definition at line 505 of file flashsv2enc.c.
Referenced by generate_default_palette().
const FFCodec ff_flashsv2_encoder |
Definition at line 913 of file flashsv2enc.c.