57 uint32_t *palette = (uint32_t *)
ctx->frame->data[1];
63 for(
a = 0;
a < 256;
a++){
64 palette[
a] = 0xFFU << 24 | bytestream2_get_be24u(
g) * 4;
65 palette[
a] |= palette[
a] >> 6 & 0x30303;
77 int remaining = avctx->
width;
78 int wrap_to_next_line;
83 block_type = bytestream2_get_byte(&vid->
g);
84 if (block_type < 1 || block_type > 4)
113 yoffset = bytestream2_get_le16(&vid->
g);
114 if(yoffset >= avctx->
height)
126 while((
code = bytestream2_get_byte(&vid->
g))){
127 int length =
code & 0x7f;
130 while(length > remaining){
134 memset(
dst, bytestream2_peek_byte(&vid->
g), remaining);
136 dst += remaining + wrap_to_next_line;
137 remaining = avctx->
width;
146 memset(
dst, bytestream2_get_byte(&vid->
g), length);
168 .p.name =
"bethsoftvid",
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
const FFCodec ff_bethsoftvid_decoder
static AVFormatContext * ctx
static av_cold void close(AVCodecParserContext *s)
Libavcodec external API header.
static int bethsoftvid_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
static av_cold int bethsoftvid_decode_end(AVCodecContext *avctx)
static int set_palette(BethsoftvidContext *ctx, GetByteContext *g)
static av_cold int bethsoftvid_decode_init(AVCodecContext *avctx)
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size)
static av_always_inline int bytestream2_get_bytes_left(const GetByteContext *g)
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
static av_always_inline int bytestream2_tell(const GetByteContext *g)
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
common internal and external API header
int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Identical in function to ff_get_buffer(), except it reuses the existing buffer if available.
int(* init)(AVBSFContext *ctx)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
@ AV_CODEC_ID_BETHSOFTVID
@ AV_PKT_DATA_PALETTE
An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE bytes worth of palette.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Macro definitions for various function/variable attributes.
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int width
picture width / height.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
enum AVPacketSideDataType type
This structure stores compressed data.
AVPacketSideData * side_data
Additional packet data that can be provided by the container.
static int64_t frame_end(const SyncQueue *sq, SyncQueueFrame frame, int nb_samples)
Compute the end timestamp of a frame.