/third_party/ffmpeg/libavcodec/ |
D | encode.c | 33 int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int64_t min_size) in ff_alloc_packet2() argument 41 av_assert0(!avpkt->data); in ff_alloc_packet2() 45 avpkt->data = avctx->internal->byte_buffer; in ff_alloc_packet2() 46 avpkt->size = size; in ff_alloc_packet2() 49 if (!avpkt->data) { in ff_alloc_packet2() 50 int ret = av_new_packet(avpkt, size); in ff_alloc_packet2() 59 int avcodec_default_get_encode_buffer(AVCodecContext *avctx, AVPacket *avpkt, int flags) in avcodec_default_get_encode_buffer() argument 63 if (avpkt->size < 0 || avpkt->size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE) in avcodec_default_get_encode_buffer() 66 if (avpkt->data || avpkt->buf) { in avcodec_default_get_encode_buffer() 71 ret = av_buffer_realloc(&avpkt->buf, avpkt->size + AV_INPUT_BUFFER_PADDING_SIZE); in avcodec_default_get_encode_buffer() [all …]
|
D | imm5.c | 87 int *got_frame, AVPacket *avpkt) in imm5_decode_frame() argument 94 … if (avpkt->size > 24 && avpkt->data[8] <= 1 && AV_RL32(avpkt->data + 4) + 24ULL <= avpkt->size) { in imm5_decode_frame() 95 int codec_type = avpkt->data[1]; in imm5_decode_frame() 96 int index = avpkt->data[10]; in imm5_decode_frame() 97 int new_size = AV_RL32(avpkt->data + 4); in imm5_decode_frame() 109 ret = av_packet_make_writable(avpkt); in imm5_decode_frame() 121 avpkt->data += 24 - offset; in imm5_decode_frame() 122 avpkt->size = new_size + offset; in imm5_decode_frame() 124 memcpy(avpkt->data, IMM5_units[index].bits, IMM5_units[index].len); in imm5_decode_frame() 126 memcpy(avpkt->data + off, IMM5_units[12].bits, IMM5_units[12].len); in imm5_decode_frame() [all …]
|
D | libtwolame.c | 107 static int twolame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, in twolame_encode_frame() argument 113 if ((ret = ff_alloc_packet2(avctx, avpkt, MPA_MAX_CODED_FRAME_SIZE, 0)) < 0) in twolame_encode_frame() 122 avpkt->data, in twolame_encode_frame() 123 avpkt->size); in twolame_encode_frame() 130 avpkt->data, avpkt->size); in twolame_encode_frame() 136 avpkt->data, avpkt->size); in twolame_encode_frame() 143 avpkt->data, avpkt->size); in twolame_encode_frame() 151 ret = twolame_encode_flush(s->glopts, avpkt->data, avpkt->size); in twolame_encode_frame() 160 avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples); in twolame_encode_frame() 162 avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->initial_padding); in twolame_encode_frame() [all …]
|
D | sbcenc.c | 96 static size_t sbc_pack_frame(AVPacket *avpkt, struct sbc_frame *frame, in sbc_pack_frame() argument 113 avpkt->data[0] = MSBC_SYNCWORD; in sbc_pack_frame() 114 avpkt->data[1] = 0; in sbc_pack_frame() 115 avpkt->data[2] = 0; in sbc_pack_frame() 117 avpkt->data[0] = SBC_SYNCWORD; in sbc_pack_frame() 119 avpkt->data[1] = (frame->frequency & 0x03) << 6; in sbc_pack_frame() 120 avpkt->data[1] |= (((frame->blocks >> 2) - 1) & 0x03) << 4; in sbc_pack_frame() 121 avpkt->data[1] |= (frame->mode & 0x03) << 2; in sbc_pack_frame() 122 avpkt->data[1] |= (frame->allocation & 0x01) << 1; in sbc_pack_frame() 123 avpkt->data[1] |= ((frame->subbands == 8) & 0x01) << 0; in sbc_pack_frame() [all …]
|
D | xbmdec.c | 67 int *got_frame, AVPacket *avpkt) in xbm_decode_frame() argument 73 const uint8_t *end, *ptr = avpkt->data; in xbm_decode_frame() 78 end = avpkt->data + avpkt->size; in xbm_decode_frame() 80 width = parse_str_int(avpkt->data, end, "_width"); in xbm_decode_frame() 81 height = parse_str_int(avpkt->data, end, "_height"); in xbm_decode_frame() 90 next = memchr(ptr, '{', avpkt->size); in xbm_decode_frame() 92 next = memchr(ptr, '(', avpkt->size); in xbm_decode_frame() 136 return avpkt->size; in xbm_decode_frame()
|
D | bitpacked.c | 41 const AVPacket *avpkt) in bitpacked_decode_uyvy422() argument 47 frame->buf[0] = av_buffer_ref(avpkt->buf); in bitpacked_decode_uyvy422() 48 ret = av_image_fill_arrays(frame->data, frame->linesize, avpkt->data, in bitpacked_decode_uyvy422() 59 const AVPacket *avpkt) in bitpacked_decode_yuv422p10() argument 62 uint64_t packet_size = (uint64_t)avpkt->size * 8; in bitpacked_decode_yuv422p10() 77 ret = init_get_bits(&bc, avpkt->data, avctx->width * avctx->height * 20); in bitpacked_decode_yuv422p10() 121 AVPacket *avpkt) in bitpacked_decode() argument 124 int buf_size = avpkt->size; in bitpacked_decode() 131 res = bc->decode(avctx, frame, avpkt); in bitpacked_decode()
|
D | libopenh264dec.c | 90 int *got_frame, AVPacket *avpkt) in svc_decode_frame() argument 102 if (!avpkt->data) { in svc_decode_frame() 111 info.uiInBsTimeStamp = avpkt->pts; in svc_decode_frame() 117 … state = (*s->decoder)->DecodeFrameNoDelay(s->decoder, avpkt->data, avpkt->size, ptrs, &info); in svc_decode_frame() 119 state = (*s->decoder)->DecodeFrame2(s->decoder, avpkt->data, avpkt->size, ptrs, &info); in svc_decode_frame() 128 return avpkt->size; in svc_decode_frame() 149 avframe->pkt_pts = avpkt->pts; in svc_decode_frame() 160 return avpkt->size; in svc_decode_frame()
|
D | 8svx.c | 87 int *got_frame_ptr, AVPacket *avpkt) in eightsvx_decode_frame() argument 96 if (!esc->data[0] && avpkt) { in eightsvx_decode_frame() 97 int chan_size = avpkt->size / avctx->channels - hdr_size; in eightsvx_decode_frame() 99 if (avpkt->size % avctx->channels) { in eightsvx_decode_frame() 102 if (avpkt->size < (hdr_size + 1) * avctx->channels) { in eightsvx_decode_frame() 107 esc->fib_acc[0] = avpkt->data[1] + 128; in eightsvx_decode_frame() 109 esc->fib_acc[1] = avpkt->data[2+chan_size+1] + 128; in eightsvx_decode_frame() 121 memcpy(esc->data[0], &avpkt->data[hdr_size], chan_size); in eightsvx_decode_frame() 123 memcpy(esc->data[1], &avpkt->data[2*hdr_size+chan_size], chan_size); in eightsvx_decode_frame() 134 return avpkt->size; in eightsvx_decode_frame()
|
D | screenpresso.c | 105 int *got_frame, AVPacket *avpkt) in screenpresso_decode_frame() argument 114 if (avpkt->size < 3) { in screenpresso_decode_frame() 115 av_log(avctx, AV_LOG_ERROR, "Packet too small (%d)\n", avpkt->size); in screenpresso_decode_frame() 120 av_log(avctx, AV_LOG_DEBUG, "Compression level %d\n", avpkt->data[0] >> 4); in screenpresso_decode_frame() 121 keyframe = avpkt->data[0] & 1; in screenpresso_decode_frame() 124 component_size = ((avpkt->data[1] >> 2) & 0x03) + 1; in screenpresso_decode_frame() 143 avpkt->data + 2, avpkt->size - 2); in screenpresso_decode_frame() 183 return avpkt->size; in screenpresso_decode_frame()
|
D | 012v.c | 39 int *got_frame, AVPacket *avpkt) in zero12v_decode_frame() argument 45 const uint8_t *line_end, *src = avpkt->data; in zero12v_decode_frame() 54 && avpkt->size % avctx->height == 0 in zero12v_decode_frame() 55 && avpkt->size / avctx->height * 3 >= width * 8) in zero12v_decode_frame() 56 stride = avpkt->size / avctx->height; in zero12v_decode_frame() 58 if (avpkt->size < avctx->height * stride) { in zero12v_decode_frame() 60 avpkt->size, avctx->height * stride); in zero12v_decode_frame() 70 line_end = avpkt->data + stride; in zero12v_decode_frame() 144 return avpkt->size; in zero12v_decode_frame()
|
D | dsddec.c | 69 const AVPacket *avpkt; member 78 const AVPacket *avpkt = td->avpkt; in dsd_channel() local 91 avpkt->data + j * src_next, src_stride, in dsd_channel() 98 int *got_frame_ptr, AVPacket *avpkt) in decode_frame() argument 104 frame->nb_samples = avpkt->size / avctx->channels; in decode_frame() 110 td.avpkt = avpkt; in decode_frame()
|
D | adxdec.c | 96 int *got_frame_ptr, AVPacket *avpkt) in adx_decode_frame() argument 99 int buf_size = avpkt->size; in adx_decode_frame() 103 const uint8_t *buf = avpkt->data; in adx_decode_frame() 104 const uint8_t *buf_end = buf + avpkt->size; in adx_decode_frame() 109 new_extradata = av_packet_get_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA, in adx_decode_frame() 154 return avpkt->size; in adx_decode_frame() 170 buf = avpkt->data + avpkt->size; in adx_decode_frame() 183 return buf - avpkt->data; in adx_decode_frame()
|
D | libopencore-amr.c | 96 int *got_frame_ptr, AVPacket *avpkt) in amr_nb_decode_frame() argument 99 const uint8_t *buf = avpkt->data; in amr_nb_decode_frame() 100 int buf_size = avpkt->size; in amr_nb_decode_frame() 233 static int amr_nb_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, in amr_nb_encode_frame() argument 246 if ((ret = ff_alloc_packet2(avctx, avpkt, 32, 0)) < 0) in amr_nb_encode_frame() 274 avpkt->data, 0); in amr_nb_encode_frame() 276 written, s->enc_mode, avpkt->data[0]); in amr_nb_encode_frame() 279 ff_af_queue_remove(&s->afq, avctx->frame_size, &avpkt->pts, in amr_nb_encode_frame() 280 &avpkt->duration); in amr_nb_encode_frame() 282 avpkt->size = written; in amr_nb_encode_frame() [all …]
|
D | sp5xdec.c | 33 int ff_sp5x_process_packet(AVCodecContext *avctx, AVPacket *avpkt) in ff_sp5x_process_packet() argument 35 const uint8_t *buf = avpkt->data; in ff_sp5x_process_packet() 36 int buf_size = avpkt->size; in ff_sp5x_process_packet() 84 av_buffer_unref(&avpkt->buf); in ff_sp5x_process_packet() 85 avpkt->buf = buf_recoded; in ff_sp5x_process_packet() 86 avpkt->data = recoded; in ff_sp5x_process_packet() 87 avpkt->size = j; in ff_sp5x_process_packet()
|
D | bethsoftvideo.c | 71 AVPacket *avpkt) in bethsoftvid_decode_frame() argument 86 if (avpkt->side_data_elems > 0 && in bethsoftvid_decode_frame() 87 avpkt->side_data[0].type == AV_PKT_DATA_PALETTE) { in bethsoftvid_decode_frame() 88 bytestream2_init(&vid->g, avpkt->side_data[0].data, in bethsoftvid_decode_frame() 89 avpkt->side_data[0].size); in bethsoftvid_decode_frame() 94 bytestream2_init(&vid->g, avpkt->data, avpkt->size); in bethsoftvid_decode_frame() 151 return avpkt->size; in bethsoftvid_decode_frame()
|
D | pcm-dvdenc.c | 110 static int pcm_dvd_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, in pcm_dvd_encode_frame() argument 122 if ((ret = ff_alloc_packet2(avctx, avpkt, pkt_size, 0)) < 0) in pcm_dvd_encode_frame() 125 memcpy(avpkt->data, s->header, 3); in pcm_dvd_encode_frame() 130 bytestream2_init_writer(&pb, avpkt->data + 3, avpkt->size - 3); in pcm_dvd_encode_frame() 165 avpkt->pts = frame->pts; in pcm_dvd_encode_frame() 166 avpkt->size = pkt_size; in pcm_dvd_encode_frame() 167 avpkt->duration = ff_samples_to_time_base(avctx, frame->nb_samples); in pcm_dvd_encode_frame()
|
D | yop.c | 194 AVPacket *avpkt) in yop_decode_frame() argument 202 if (avpkt->size < 4 + 3 * s->num_pal_colors) { in yop_decode_frame() 215 s->srcptr = avpkt->data + 4; in yop_decode_frame() 216 s->src_end = avpkt->data + avpkt->size; in yop_decode_frame() 219 is_odd_frame = avpkt->data[0]; in yop_decode_frame() 239 if (s->srcptr - avpkt->data >= avpkt->size) { in yop_decode_frame() 265 return avpkt->size; in yop_decode_frame()
|
D | adxenc.c | 140 static int adx_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, in adx_encode_frame() argument 151 if ((ret = ff_alloc_packet2(avctx, avpkt, 18, 0)) < 0) in adx_encode_frame() 154 dst = avpkt->data; in adx_encode_frame() 165 if ((ret = ff_alloc_packet2(avctx, avpkt, out_size, 0)) < 0) in adx_encode_frame() 167 dst = avpkt->data; in adx_encode_frame() 171 if ((hdrsize = adx_encode_header(avctx, dst, avpkt->size)) < 0) { in adx_encode_frame() 184 avpkt->pts = frame->pts; in adx_encode_frame() 185 avpkt->duration = frame->nb_samples; in adx_encode_frame()
|
D | movtextdec.c | 120 int (*decode)(const uint8_t *tsmb, MovTextContext *m, const AVPacket *avpkt); 243 static int decode_twrp(const uint8_t *tsmb, MovTextContext *m, const AVPacket *avpkt) in decode_twrp() argument 250 static int decode_hlit(const uint8_t *tsmb, MovTextContext *m, const AVPacket *avpkt) in decode_hlit() argument 258 static int decode_hclr(const uint8_t *tsmb, MovTextContext *m, const AVPacket *avpkt) in decode_hclr() argument 265 static int decode_styl(const uint8_t *tsmb, MovTextContext *m, const AVPacket *avpkt) in decode_styl() argument 272 if (m->tracksize + m->size_var + 2 + style_entries * 12 > avpkt->size) in decode_styl() 461 void *data, int *got_sub_ptr, AVPacket *avpkt) in mov_text_decode_frame() argument 467 char *ptr = avpkt->data; in mov_text_decode_frame() 474 if (!ptr || avpkt->size < 2) in mov_text_decode_frame() 484 if (avpkt->size == 2) in mov_text_decode_frame() [all …]
|
D | libmp3lame.c | 188 static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, in mp3lame_encode_frame() argument 267 if ((ret = ff_alloc_packet2(avctx, avpkt, len, 0)) < 0) in mp3lame_encode_frame() 269 memcpy(avpkt->data, s->buffer, len); in mp3lame_encode_frame() 274 ff_af_queue_remove(&s->afq, avctx->frame_size, &avpkt->pts, in mp3lame_encode_frame() 275 &avpkt->duration); in mp3lame_encode_frame() 277 discard_padding = avctx->frame_size - avpkt->duration; in mp3lame_encode_frame() 279 if ((discard_padding < avctx->frame_size) != (avpkt->duration > 0)) { in mp3lame_encode_frame() 281 av_packet_unref(avpkt); in mp3lame_encode_frame() 285 uint8_t* side_data = av_packet_new_side_data(avpkt, in mp3lame_encode_frame() 289 av_packet_unref(avpkt); in mp3lame_encode_frame() [all …]
|
/third_party/ffmpeg/libavcodec/tests/ |
D | avpacket.c | 28 static int setup_side_data_entry(AVPacket* avpkt) in setup_side_data_entry() argument 50 ret = av_packet_add_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA, in setup_side_data_entry() 61 static int initializations(AVPacket* avpkt) in initializations() argument 67 avpkt->pts = 17; in initializations() 68 avpkt->dts = 2; in initializations() 69 avpkt->data = (uint8_t*)data; in initializations() 70 avpkt->size = strlen(data); in initializations() 71 avpkt->flags = AV_PKT_FLAG_DISCARD; in initializations() 72 avpkt->duration = 100; in initializations() 73 avpkt->pos = 3; in initializations() [all …]
|
/third_party/ffmpeg/libavcodec/aarch64/ |
D | neontest.c | 36 AVPacket *avpkt)) in wrap() argument 39 got_frame_ptr, avpkt); in wrap() 45 AVPacket *avpkt)) in wrap() argument 48 got_picture_ptr, avpkt); in wrap() 52 AVPacket *avpkt, in wrap() argument 56 testneonclobbers(avcodec_encode_audio2, avctx, avpkt, frame, in wrap() 60 wrap(avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt, in wrap() argument 63 testneonclobbers(avcodec_encode_video2, avctx, avpkt, frame, got_packet_ptr); in wrap() 70 AVPacket *avpkt)) in wrap() argument 73 got_sub_ptr, avpkt); in wrap() [all …]
|
/third_party/ffmpeg/libavcodec/arm/ |
D | neontest.c | 36 AVPacket *avpkt)) in wrap() argument 39 got_frame_ptr, avpkt); in wrap() 45 AVPacket *avpkt)) in wrap() argument 48 got_picture_ptr, avpkt); in wrap() 52 AVPacket *avpkt, in wrap() argument 56 testneonclobbers(avcodec_encode_audio2, avctx, avpkt, frame, in wrap() 60 wrap(avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt, in wrap() argument 63 testneonclobbers(avcodec_encode_video2, avctx, avpkt, frame, got_packet_ptr); in wrap() 70 AVPacket *avpkt)) in wrap() argument 73 got_sub_ptr, avpkt); in wrap() [all …]
|
/third_party/ffmpeg/libavcodec/x86/ |
D | w64xmmtest.c | 36 AVPacket *avpkt)) in wrap() argument 39 got_frame_ptr, avpkt); in wrap() 45 AVPacket *avpkt)) in wrap() argument 48 got_picture_ptr, avpkt); in wrap() 52 AVPacket *avpkt, in wrap() argument 56 testxmmclobbers(avcodec_encode_audio2, avctx, avpkt, frame, in wrap() 60 wrap(avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt, in wrap() argument 63 testxmmclobbers(avcodec_encode_video2, avctx, avpkt, frame, got_packet_ptr); in wrap() 70 AVPacket *avpkt)) in wrap() argument 73 got_sub_ptr, avpkt); in wrap() [all …]
|
/third_party/ffmpeg/tools/ |
D | target_dec_fuzzer.c | 82 int *got_sub_ptr, AVPacket *avpkt) in subtitle_handler() argument 85 int ret = avcodec_decode_subtitle2(avctx, &sub, got_sub_ptr, avpkt); in subtitle_handler() 118 const AVPacket *avpkt) = NULL; in LLVMFuzzerTestOneInput() 299 AVPacket *avpkt = av_packet_alloc(); in LLVMFuzzerTestOneInput() local 301 if (!frame || !avpkt || !parsepkt) in LLVMFuzzerTestOneInput() 328 int ret = av_parser_parse2(parser, parser_avctx, &avpkt->data, &avpkt->size, in LLVMFuzzerTestOneInput() 331 if (avpkt->data == parsepkt->data) { in LLVMFuzzerTestOneInput() 332 avpkt->buf = av_buffer_ref(parsepkt->buf); in LLVMFuzzerTestOneInput() 333 if (!avpkt->buf) in LLVMFuzzerTestOneInput() 336 if (av_packet_make_refcounted(avpkt) < 0) in LLVMFuzzerTestOneInput() [all …]
|