project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
FFmpeg | fc85646ad495f3418042468da415af73a7a07334 | 1 | static av_cold int libopus_decode_init(AVCodecContext *avc)
{
struct libopus_context *opus = avc->priv_data;
int ret, channel_map = 0, gain_db = 0, nb_streams, nb_coupled;
uint8_t mapping_arr[8] = { 0, 1 }, *mapping;
avc->sample_rate = 48000;
avc->sample_fmt = avc->request_sample_fmt == AV_SA... | 19,618 |
qemu | 632314c49ce20ee9c974f07544d9125fbbbfbe1b | 1 | gen_intermediate_code_internal(CPUCRISState *env, TranslationBlock *tb,
int search_pc)
{
uint16_t *gen_opc_end;
uint32_t pc_start;
unsigned int insn_len;
int j, lj;
struct DisasContext ctx;
struct DisasContext *dc = &ctx;
uint32_t next_page_start;
... | 19,619 |
qemu | 4cad3867b6df2c0826ae508a9fe15dd0b9d8936a | 1 | int fw_cfg_add_callback(FWCfgState *s, uint16_t key, FWCfgCallback callback,
void *callback_opaque, uint8_t *data, size_t len)
{
int arch = !!(key & FW_CFG_ARCH_LOCAL);
if (!(key & FW_CFG_WRITE_CHANNEL))
return 0;
key &= FW_CFG_ENTRY_MASK;
if (key >= FW_CFG_M... | 19,621 |
qemu | 966439a67830239a6c520c5df6c55627b8153c8b | 1 | void do_subfmeo_64 (void)
{
T1 = T0;
T0 = ~T0 + xer_ca - 1;
if (likely(!((uint64_t)~T1 & ((uint64_t)~T1 ^ (uint64_t)T0) &
(1ULL << 63)))) {
xer_ov = 0;
} else {
xer_so = 1;
xer_ov = 1;
}
if (likely((uint64_t)T1 != UINT64_MAX))
xer_ca =... | 19,622 |
FFmpeg | fcd19d6c8db514b017662166d014ac8560fbe8f5 | 1 | static void jpeg2000_dec_cleanup(Jpeg2000DecoderContext *s)
{
int tileno, compno;
for (tileno = 0; tileno < s->numXtiles * s->numYtiles; tileno++) {
if (s->tile[tileno].comp) {
for (compno = 0; compno < s->ncomponents; compno++) {
Jpeg2000Component *comp = s->tile[t... | 19,623 |
FFmpeg | 01ecb7172b684f1c4b3e748f95c5a9a494ca36ec | 1 | static void quantize_and_encode_band_cost_ESC_mips(struct AACEncContext *s,
PutBitContext *pb, const float *in, float *out,
const float *scaled, int size, int scale_idx,
... | 19,624 |
FFmpeg | e5540b3fd30367ce3cc33b2f34a04b660dbc4b38 | 0 | static int vc9_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
VC9Context *v = avctx->priv_data;
int ret = FRAME_SKIPED, len, start_code;
AVFrame *pict = data;
uint8_t *tmp_buf;
v->avctx = a... | 19,626 |
FFmpeg | e509df4bc8eb3aebdda71b826955d581e717fb0e | 0 | static int compand_delay(AVFilterContext *ctx, AVFrame *frame)
{
CompandContext *s = ctx->priv;
AVFilterLink *inlink = ctx->inputs[0];
const int channels = inlink->channels;
const int nb_samples = frame->nb_samples;
int chan, i, av_uninit(dindex), oindex, av_uninit(count);
AVFrame *out... | 19,627 |
FFmpeg | 65c7bb9ec4f521a46577a1e87d71ad9a8deee6cd | 0 | static void vc1_overlap_block(MpegEncContext *s, DCTELEM block[64], int n, int do_hor, int do_vert)
{
int i;
if(do_hor) { //TODO
}
if(do_vert) { //TODO
}
for(i = 0; i < 64; i++)
block[i] += 128;
}
| 19,628 |
FFmpeg | 25b6837f7cacd691b19cbc12b9dad1ce84a318a1 | 0 | static int32_t parse_gain(const char *gain)
{
char *fraction;
int scale = 10000;
int32_t mb = 0;
int db;
if (!gain)
return INT32_MIN;
gain += strspn(gain, " \t");
db = strtol(gain, &fraction, 0);
if (*fraction++ == '.') {
while (av_isdigit(*fraction) && ... | 19,629 |
FFmpeg | 26f6b8c571bcff7b325c7d6cc226c625dd465f8e | 1 | int ffurl_read(URLContext *h, unsigned char *buf, int size)
{
if (h->flags & AVIO_FLAG_WRITE)
return AVERROR(EIO);
return retry_transfer_wrapper(h, buf, size, 1, h->prot->url_read);
}
| 19,630 |
qemu | efec3dd631d94160288392721a5f9c39e50fb2bc | 1 | static void spapr_vio_bridge_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
k->init = spapr_vio_bridge_init;
dc->no_user = 1;
}
| 19,631 |
qemu | a33609cae0d57a7574608145f553cc5279221c31 | 1 | int kvm_arch_init_vcpu(CPUState *env)
{
struct {
struct kvm_cpuid2 cpuid;
struct kvm_cpuid_entry2 entries[100];
} __attribute__((packed)) cpuid_data;
uint32_t limit, i, j, cpuid_i;
uint32_t eax, ebx, ecx, edx;
cpuid_i = 0;
cpu_x86_cpuid(env, 0, 0, &eax, &ebx, &ecx, &... | 19,632 |
FFmpeg | ff100c9dd97d2f1f456ff38b192edf84f9744738 | 1 | static int webm_dash_manifest_read_header(AVFormatContext *s)
{
char *buf;
int ret = matroska_read_header(s);
MatroskaTrack *tracks;
MatroskaDemuxContext *matroska = s->priv_data;
if (ret) {
av_log(s, AV_LOG_ERROR, "Failed to read file headers\n");
return -1;
if ... | 19,634 |
FFmpeg | 622d463000371467cb0365744f0c1d92b56bed52 | 1 | static int build_table(VLC *vlc, int table_nb_bits, int nb_codes,
VLCcode *codes, int flags)
{
int table_size, table_index, index, code_prefix, symbol, subtable_bits;
int i, j, k, n, nb, inc;
uint32_t code;
VLC_TYPE (*table)[2];
table_size = 1 << table_nb_bits;
i... | 19,635 |
FFmpeg | 2dd0da787ce5008d4d1b8f461fbd1288c32e2c38 | 1 | static int mp3_write_audio_packet(AVFormatContext *s, AVPacket *pkt)
{
MP3Context *mp3 = s->priv_data;
if (pkt->data && pkt->size >= 4) {
MPADecodeHeader c;
int av_unused base;
avpriv_mpegaudio_decode_header(&c, AV_RB32(pkt->data));
if (!mp3->initial_bitrate)
... | 19,636 |
qemu | 359507eed1b6d8ae2392e0c8fe32d5f0de9d1d75 | 1 | static int handle_instruction(CPUState *env, struct kvm_run *run)
{
unsigned int ipa0 = (run->s390_sieic.ipa & 0xff00);
uint8_t ipa1 = run->s390_sieic.ipa & 0x00ff;
int ipb_code = (run->s390_sieic.ipb & 0x0fff0000) >> 16;
int r = -1;
dprintf("handle_instruction 0x%x 0x%x\n", run->s390_sieic.... | 19,637 |
FFmpeg | a19989cae581817e8857623d3afc447372b1c0e3 | 1 | static int process_output_surface(AVCodecContext *avctx, AVPacket *pkt, NvencSurface *tmpoutsurf)
{
NvencContext *ctx = avctx->priv_data;
NvencDynLoadFunctions *dl_fn = &ctx->nvenc_dload_funcs;
NV_ENCODE_API_FUNCTION_LIST *p_nvenc = &dl_fn->nvenc_funcs;
uint32_t slice_mode_data;
uint32_t *sl... | 19,638 |
FFmpeg | 9487fb4dea3498eb4711eb023f43199f68701b1e | 1 | yuv2422_1_c_template(SwsContext *c, const int16_t *buf0,
const int16_t *ubuf[2], const int16_t *vbuf[2],
const int16_t *abuf0, uint8_t *dest, int dstW,
int uvalpha, int y, enum PixelFormat target)
{
const int16_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0];
... | 19,639 |
qemu | 0ead93120eb7bd770b32adc00b5ec1ee721626dc | 1 | static int coroutine_fn iscsi_co_readv(BlockDriverState *bs,
int64_t sector_num, int nb_sectors,
QEMUIOVector *iov)
{
IscsiLun *iscsilun = bs->opaque;
struct IscsiTask iTask;
uint64_t lba;
uint32_t num_sectors;
i... | 19,640 |
qemu | 5e39d89d20b17cf6fb7f09d181d34f17b2ae2160 | 1 | static void spapr_numa_cpu(const void *data)
{
char *cli;
QDict *resp;
QList *cpus;
const QObject *e;
cli = make_cli(data, "-smp 4,cores=4 "
"-numa node,nodeid=0 -numa node,nodeid=1 "
"-numa cpu,node-id=0,core-id=0 "
"-numa cpu,node-id=0,core-id=1 "
"-numa... | 19,641 |
qemu | 3e305e4a4752f70c0b5c3cf5b43ec957881714f7 | 1 | ssize_t vnc_client_read_buf(VncState *vs, uint8_t *data, size_t datalen)
{
ssize_t ret;
#ifdef CONFIG_VNC_TLS
if (vs->tls.session) {
ret = vnc_client_read_tls(&vs->tls.session, data, datalen);
} else {
#endif /* CONFIG_VNC_TLS */
ret = qemu_recv(vs->csock, data, datalen, 0);
#ifdef ... | 19,642 |
qemu | 60fe637bf0e4d7989e21e50f52526444765c63b4 | 1 | void qemu_put_be64(QEMUFile *f, uint64_t v)
{
qemu_put_be32(f, v >> 32);
qemu_put_be32(f, v);
}
| 19,644 |
qemu | d861b05ea30e6ac177de9b679da96194ebe21afc | 1 | void lance_init(NICInfo *nd, int irq, uint32_t leaddr, uint32_t ledaddr)
{
LANCEState *s;
int lance_io_memory, ledma_io_memory;
s = qemu_mallocz(sizeof(LANCEState));
if (!s)
return;
s->irq = irq;
lance_io_memory = cpu_register_io_memory(0, lance_mem_read, lance_mem_write, s... | 19,645 |
FFmpeg | 55354b7de21e7bb4bbeb1c12ff55ea17f807c70c | 1 | static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb, int channel, int *last)
{
int t, t2;
int sign, base, add, ret;
WvChannel *c = &ctx->ch[channel];
*last = 0;
if((ctx->ch[0].median[0] < 2U) && (ctx->ch[1].median[0] < 2U) && !ctx->zero && !ctx->one){
if(ctx->zeroe... | 19,646 |
qemu | b8afb520e479e693c227aa39c2fb7670743e104f | 1 | static int block_save_setup(QEMUFile *f, void *opaque)
{
int ret;
DPRINTF("Enter save live setup submitted %d transferred %d\n",
block_mig_state.submitted, block_mig_state.transferred);
qemu_mutex_lock_iothread();
init_blk_migration(f);
/* start track dirty blocks */
se... | 19,647 |
qemu | 711e2f1e9ecad845e142fdddbbf1e8037bce902b | 1 | static void test_dynamic_globalprop(void)
{
MyType *mt;
static GlobalProperty props[] = {
{ TYPE_DYNAMIC_PROPS, "prop1", "101" },
{ TYPE_DYNAMIC_PROPS, "prop2", "102" },
{ TYPE_DYNAMIC_PROPS"-bad", "prop3", "103", true },
{}
};
int all_used;
qdev_prop_regi... | 19,649 |
FFmpeg | 21b5990da461e4f83cf53994715ed42e22cce9e0 | 0 | void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
{
if (min_size < *size)
return ptr;
min_size = FFMAX(min_size + min_size / 16 + 32, min_size);
ptr = av_realloc(ptr, min_size);
/* we could set this to the unmodified min_size but this is safer
* if the user lo... | 19,651 |
FFmpeg | 39185ec4faa9ef33954dbf2394444e045b632673 | 0 | static inline int decode_residual_inter(AVSContext *h)
{
int block;
/* get coded block pattern */
int cbp = get_ue_golomb(&h->gb);
if (cbp > 63) {
av_log(h->avctx, AV_LOG_ERROR, "illegal inter cbp\n");
return AVERROR_INVALIDDATA;
}
h->cbp = cbp_tab[cbp][1];
/* g... | 19,652 |
FFmpeg | 6e42ccb9dbc13836cd52cda594f819d17af9afa2 | 0 | static int decode_pulses(Pulse *pulse, GetBitContext *gb,
const uint16_t *swb_offset, int num_swb)
{
int i, pulse_swb;
pulse->num_pulse = get_bits(gb, 2) + 1;
pulse_swb = get_bits(gb, 6);
if (pulse_swb >= num_swb)
return -1;
pulse->pos[0] = swb_offs... | 19,653 |
FFmpeg | 87e8788680e16c51f6048af26f3f7830c35207a5 | 0 | static int aiff_probe(AVProbeData *p)
{
/* check file header */
if (p->buf_size < 16)
return 0;
if (p->buf[0] == 'F' && p->buf[1] == 'O' &&
p->buf[2] == 'R' && p->buf[3] == 'M' &&
p->buf[8] == 'A' && p->buf[9] == 'I' &&
p->buf[10] == 'F' && (p->buf[11] == 'F' || p->bu... | 19,655 |
FFmpeg | 56c07e298914d0533a74bb4ba4be4abc8ea6b245 | 0 | static int encode_residual(FlacEncodeContext *ctx, int ch)
{
int i, n;
int min_order, max_order, opt_order, precision, omethod;
int min_porder, max_porder;
FlacFrame *frame;
FlacSubframe *sub;
int32_t coefs[MAX_LPC_ORDER][MAX_LPC_ORDER];
int shift[MAX_LPC_ORDER];
int32_t *res, *... | 19,656 |
FFmpeg | 5d97d9d53ea1cc2c28411ad734565372ddeccc32 | 1 | static int decode_stream_header(NUTContext *nut){
AVFormatContext *s= nut->avf;
ByteIOContext *bc = &s->pb;
StreamContext *stc;
int class, nom, denom, stream_id;
uint64_t tmp, end;
AVStream *st;
end= get_packetheader(nut, bc, 1);
end += url_ftell(bc) - 4;
GET_V(stream_id... | 19,657 |
FFmpeg | 44272c1cccfb92415801ae60693a7ed04e458916 | 1 | void avformat_close_input(AVFormatContext **ps)
{
AVFormatContext *s = *ps;
AVIOContext *pb = (s->iformat->flags & AVFMT_NOFILE) || (s->flags & AVFMT_FLAG_CUSTOM_IO) ?
NULL : s->pb;
flush_packet_queue(s);
if (s->iformat->read_close)
s->iformat->read_close(s);
a... | 19,658 |
qemu | 44696296d5c2ffccef9d43d37d4f525bba7d9f5c | 1 | static void cris_alu(DisasContext *dc, int op,
TCGv d, TCGv op_a, TCGv op_b, int size)
{
TCGv tmp;
int writeback;
writeback = 1;
if (op == CC_OP_BOUND || op == CC_OP_BTST)
tmp = tcg_temp_local_new(TCG_TYPE_TL);
else
tmp = tcg_temp_new(TCG_TYPE_TL);
if (op == CC_OP_CMP) {
writeback... | 19,660 |
FFmpeg | 8821ae649e61097ec57ca58472c3e4239c82913c | 1 | int avresample_set_matrix(AVAudioResampleContext *avr, const double *matrix,
int stride)
{
int in_channels, out_channels, i, o;
in_channels = av_get_channel_layout_nb_channels(avr->in_channel_layout);
out_channels = av_get_channel_layout_nb_channels(avr->out_channel_layout)... | 19,661 |
FFmpeg | 68caef9d48c4f1540b1b3181ebe7062a3417c62a | 1 | av_cold void ff_vp9dsp_init(VP9DSPContext *dsp, int bpp, int bitexact)
{
if (bpp == 8) {
ff_vp9dsp_init_8(dsp);
} else if (bpp == 10) {
ff_vp9dsp_init_10(dsp);
} else {
av_assert0(bpp == 12);
ff_vp9dsp_init_12(dsp);
}
if (ARCH_X86) ff_vp9dsp_init_x86(dsp,... | 19,663 |
FFmpeg | 1795dccde0ad22fc8201142f92fb8d58c234f3e4 | 1 | FFAMediaCodec* ff_AMediaCodec_createCodecByName(const char *name)
{
JNIEnv *env = NULL;
FFAMediaCodec *codec = NULL;
jstring codec_name = NULL;
codec = av_mallocz(sizeof(FFAMediaCodec));
if (!codec) {
return NULL;
}
codec->class = &amediacodec_class;
env = ff_jni_ge... | 19,664 |
qemu | d8f94e1bb275ab6a14a15220fd6afd0d04324aeb | 1 | void ide_drive_get(DriveInfo **hd, int max_bus)
{
int i;
if (drive_get_max_bus(IF_IDE) >= max_bus) {
fprintf(stderr, "qemu: too many IDE bus: %d\n", max_bus);
exit(1);
}
for(i = 0; i < max_bus * MAX_IDE_DEVS; i++) {
hd[i] = drive_get(IF_IDE, i / MAX_IDE_DEVS, i % MAX_... | 19,668 |
qemu | 153d02e338a063ad5c51ff0725d5d88285f44121 | 1 | static void release_keys(void *opaque)
{
int i;
for (i = 0; i < keycodes_size; i++) {
if (keycodes[i] & 0x80) {
kbd_put_keycode(0xe0);
}
kbd_put_keycode(keycodes[i]| 0x80);
}
free_keycodes();
}
| 19,669 |
FFmpeg | f36aec3b5e18c4c167612d0051a6d5b6144b3552 | 1 | static int mace6_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
const uint8_t *buf, int buf_size)
{
int16_t *samples = data;
MACEContext *ctx = avctx->priv_data;
int i, j;
for(i = 0; i < avctx->channels; i++) {
... | 19,670 |
FFmpeg | ca8064d2d1b293d7a8011bf0a08005c11ae8ba67 | 1 | static void new_video_stream(AVFormatContext *oc)
{
AVStream *st;
AVCodecContext *video_enc;
enum CodecID codec_id;
AVCodec *codec= NULL;
st = av_new_stream(oc, oc->nb_streams < nb_streamid_map ? streamid_map[oc->nb_streams] : 0);
if (!st) {
fprintf(stderr, "Could not alloc str... | 19,671 |
qemu | 297a3646c2947ee64a6d42ca264039732c6218e0 | 1 | void visit_start_implicit_struct(Visitor *v, void **obj, size_t size,
Error **errp)
{
if (!error_is_set(errp) && v->start_implicit_struct) {
v->start_implicit_struct(v, obj, size, errp);
}
}
| 19,672 |
qemu | 67403dbba76fb294fb3a2317227f4b77037145cc | 1 | static int multiwrite_f(int argc, char **argv)
{
struct timeval t1, t2;
int Cflag = 0, qflag = 0;
int c, cnt;
char **buf;
int64_t offset, first_offset = 0;
/* Some compilers get confused and warn if this is not initialized. */
int total = 0;
int nr_iov;
int nr_reqs;
i... | 19,673 |
FFmpeg | 5c2fb561d94fc51d76ab21d6f7cc5b6cc3aa599c | 0 | static void vaapi_encode_h264_write_sps(PutBitContext *pbc,
VAAPIEncodeContext *ctx)
{
VAEncSequenceParameterBufferH264 *vseq = ctx->codec_sequence_params;
VAAPIEncodeH264Context *priv = ctx->priv_data;
VAAPIEncodeH264MiscSequenceParams *mseq = &priv-... | 19,675 |
FFmpeg | d9a9f50a3683b577e9c391ce8cab9edc9b239fcb | 0 | static int pix_norm1_c(uint8_t * pix, int line_size)
{
int s, i, j;
uint32_t *sq = ff_squareTbl + 256;
s = 0;
for (i = 0; i < 16; i++) {
for (j = 0; j < 16; j += 8) {
#if 0
s += sq[pix[0]];
s += sq[pix[1]];
s += sq[pix[2]];
s += sq[pix... | 19,676 |
FFmpeg | 7656c4c6e66f8a787d384f027ad824cc1677fda1 | 0 | static void restore_median(uint8_t *src, int step, int stride,
int width, int height, int slices, int rmode)
{
int i, j, slice;
int A, B, C;
uint8_t *bsrc;
int slice_start, slice_height;
const int cmask = ~rmode;
for (slice = 0; slice < slices; slice++) {
... | 19,677 |
FFmpeg | 3b57bb478ff4455773378355e285877d757e151e | 0 | static int svq1_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
SVQ1Context *s = avctx->priv_data;
AVFrame *cur = s->cur;
uint8_t *current;
int re... | 19,678 |
FFmpeg | 9341e9497b1162726f09c1ff73edc95364b3c21a | 0 | static int init_context_frame(MpegEncContext *s)
{
int y_size, c_size, yc_size, i, mb_array_size, mv_table_size, x, y;
s->mb_width = (s->width + 15) / 16;
s->mb_stride = s->mb_width + 1;
s->b8_stride = s->mb_width * 2 + 1;
s->b4_stride = s->mb_width * 4 + 1;
mb_array_size = s->mb_h... | 19,679 |
FFmpeg | 38bb5a5434f913451aa512624a92b12b9925690f | 0 | static void mpeg4_encode_gop_header(MpegEncContext * s){
int hours, minutes, seconds;
int64_t time;
put_bits(&s->pb, 16, 0);
put_bits(&s->pb, 16, GOP_STARTCODE);
time= s->current_picture_ptr->pts;
if(s->reordered_input_picture[1])
time= FFMIN(time, s->reordered_input_picture[1... | 19,680 |
FFmpeg | 618b067d2132b0336e609bc311e85c557ffb30ed | 0 | static int ws_snd_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
// WSSNDContext *c = avctx->priv_data;
int in_size, out_size;
int sample = 128;
int i;
... | 19,681 |
FFmpeg | 221b804f3491638ecf2eec1302c669ad2d9ec799 | 1 | static int doTest(uint8_t *ref[3], int refStride[3], int w, int h, int srcFormat, int dstFormat,
int srcW, int srcH, int dstW, int dstH, int flags){
uint8_t *src[3];
uint8_t *dst[3];
uint8_t *out[3];
int srcStride[3], dstStride[3];
int i;
uint64_t ssdY, ssdU, ssdV;
struct SwsContext *s... | 19,683 |
qemu | 12848bfc5d719bad536c5448205a3226be1fda47 | 1 | static int local_mknod(FsContext *fs_ctx, const char *path, FsCred *credp)
{
int err = -1;
int serrno = 0;
/* Determine the security model */
if (fs_ctx->fs_sm == SM_MAPPED) {
err = mknod(rpath(fs_ctx, path), SM_LOCAL_MODE_BITS|S_IFREG, 0);
if (err == -1) {
return e... | 19,686 |
FFmpeg | 1b90e2414df070d4ea7d12f300c4a950d3ecc975 | 1 | uint32_t ff_celt_encode_band(CeltFrame *f, OpusRangeCoder *rc, const int band,
float *X, float *Y, int N, int b, uint32_t blocks,
float *lowband, int duration, float *lowband_out, int level,
float gain, float *lowband_scratch, int... | 19,687 |
qemu | 7e09797c299712cafa7bc05dd57c1b13afcc6039 | 1 | static void pmsav5_data_ap_write(CPUARMState *env, const ARMCPRegInfo *ri,
uint64_t value)
{
env->cp15.c5_data = extended_mpu_ap_bits(value);
}
| 19,688 |
FFmpeg | 362271d72fc38cd1f4b076aff9a12b1104c26760 | 0 | static int mv_read_packet(AVFormatContext *avctx, AVPacket *pkt)
{
MvContext *mv = avctx->priv_data;
AVIOContext *pb = avctx->pb;
AVStream *st = avctx->streams[mv->stream_index];
const AVIndexEntry *index;
int frame = mv->frame[mv->stream_index];
int ret;
uint64_t pos;
if (fra... | 19,690 |
FFmpeg | b024209b1fe57b7902d30a8e0d38f5ecb628e6f3 | 0 | static int adx_parse(AVCodecParserContext *s1,
AVCodecContext *avctx,
const uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size)
{
ADXParseContext *s = s1->priv_data;
ParseContext *pc = &s->pc;
int nex... | 19,691 |
FFmpeg | b5da07d4340a8e8e40dcd1900977a76ff31fbb84 | 0 | void ff_put_h264_qpel8_mc10_msa(uint8_t *dst, const uint8_t *src,
ptrdiff_t stride)
{
avc_luma_hz_qrt_8w_msa(src - 2, stride, dst, stride, 8, 0);
}
| 19,692 |
FFmpeg | 3ee8ca9b0894df3aaf5086c643283cb58ef9763d | 0 | static int decode_dvd_subtitles(AVSubtitle *sub_header,
const uint8_t *buf, int buf_size)
{
int cmd_pos, pos, cmd, x1, y1, x2, y2, offset1, offset2, next_cmd_pos;
int big_offsets, offset_size, is_8bit = 0;
const uint8_t *yuv_palette = 0;
uint8_t colormap[4], alpha[2... | 19,693 |
FFmpeg | 6470abc740367cc881c181db866891f8dd1d342f | 0 | static AVFrame *apply_palette(AVFilterLink *inlink, AVFrame *in)
{
int x, y, w, h;
AVFilterContext *ctx = inlink->dst;
PaletteUseContext *s = ctx->priv;
AVFilterLink *outlink = inlink->dst->outputs[0];
AVFrame *out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
if (!out) {
... | 19,694 |
FFmpeg | b4043ef504b77c357d33ffa2be28ed1c4eeecf7f | 1 | static av_cold int flic_decode_init(AVCodecContext *avctx)
{
FlicDecodeContext *s = avctx->priv_data;
unsigned char *fli_header = (unsigned char *)avctx->extradata;
int depth;
if (avctx->extradata_size != 0 &&
avctx->extradata_size != 12 &&
avctx->extradata_size != 128 &&
... | 19,695 |
qemu | e8ca1db29b349e780743c504cb735c8e1d542a8c | 1 | static int loadvm_postcopy_handle_advise(MigrationIncomingState *mis)
{
PostcopyState ps = postcopy_state_set(POSTCOPY_INCOMING_ADVISE);
uint64_t remote_hps, remote_tps;
trace_loadvm_postcopy_handle_advise();
if (ps != POSTCOPY_INCOMING_NONE) {
error_report("CMD_POSTCOPY_ADVISE in wrong ... | 19,696 |
FFmpeg | 32be264cea542b4dc721b10092bf1dfe511a28ee | 1 | static void search_for_quantizers_twoloop(AVCodecContext *avctx,
AACEncContext *s,
SingleChannelElement *sce,
const float lambda)
{
int start = 0, i, w, w2, g;
int destbits = avctx... | 19,697 |
qemu | 7453c96b78c2b09aa72924f933bb9616e5474194 | 1 | static void compare_refcounts(BlockDriverState *bs, BdrvCheckResult *res,
BdrvCheckMode fix, bool *rebuild,
int64_t *highest_cluster,
uint16_t *refcount_table, int64_t nb_clusters)
{
BDRVQcowState *s = bs->opaque;
in... | 19,698 |
qemu | c8cccba3125d8d1a7ca66fc593a89543f3fe823d | 1 | static void xilinx_spips_realize(DeviceState *dev, Error **errp)
{
XilinxSPIPS *s = XILINX_SPIPS(dev);
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
XilinxSPIPSClass *xsc = XILINX_SPIPS_GET_CLASS(s);
int i;
DB_PRINT_L(0, "realized spips\n");
s->spi = g_new(SSIBus *, s->num_busses);
fo... | 19,699 |
qemu | 686eeb93d5738c84c59395b2ec6f8181c2b7cbed | 1 | int32_t HELPER(sdiv)(int32_t num, int32_t den)
{
if (den == 0)
return 0;
return num / den;
} | 19,700 |
qemu | 90ce8a061bdcc485a56142cae68cfbfff270e634 | 1 | static void bdrv_move_feature_fields(BlockDriverState *bs_dest,
BlockDriverState *bs_src)
{
/* move some fields that need to stay attached to the device */
bs_dest->open_flags = bs_src->open_flags;
/* dev info */
bs_dest->dev_ops = bs_src->... | 19,701 |
FFmpeg | 99cf943339a2e5171863c48cd1a73dd43dc243e1 | 1 | int ff_dxva2_common_end_frame(AVCodecContext *avctx, AVFrame *frame,
const void *pp, unsigned pp_size,
const void *qm, unsigned qm_size,
int (*commit_bs_si)(AVCodecContext *,
D... | 19,702 |
FFmpeg | 9522a752bf4179b69fa9e334ee755405ba8f4459 | 1 | static int xsub_encode(AVCodecContext *avctx, unsigned char *buf,
int bufsize, void *data)
{
AVSubtitle *h = data;
uint64_t startTime = h->pts / 1000; // FIXME: need better solution...
uint64_t endTime = startTime + h->end_display_time - h->start_display_time;
int start_tc[4... | 19,703 |
FFmpeg | 1891dfe0130991ee138d01f2877678de717b9e23 | 1 | void avcodec_register_all(void)
{
static int initialized;
if (initialized)
return;
initialized = 1;
/* hardware accelerators */
REGISTER_HWACCEL(H263_CUVID, h263_cuvid);
REGISTER_HWACCEL(H263_VAAPI, h263_vaapi);
REGISTER_HWACCEL(H263_VIDEOTOOLBOX, h263_vide... | 19,704 |
qemu | 3c0c47e3464f3c54bd3f1cc6d4da2cbf7465e295 | 1 | static void spapr_machine_device_unplug(HotplugHandler *hotplug_dev,
DeviceState *dev, Error **errp)
{
sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(qdev_get_machine());
if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) {
error_setg(errp, "Memory hot unp... | 19,705 |
FFmpeg | 4ffbe3f3a5d9892841d9bc31d859916c2c61123f | 1 | static int mkv_add_cuepoint(mkv_cues *cues, int stream, int64_t ts, int64_t cluster_pos)
{
mkv_cuepoint *entries = cues->entries;
entries = av_realloc(entries, (cues->num_entries + 1) * sizeof(mkv_cuepoint));
if (entries == NULL)
return AVERROR(ENOMEM);
if (ts < 0)
return 0;
... | 19,706 |
qemu | 7d1b0095bff7157e856d1d0e6c4295641ced2752 | 1 | static void gen_exception(int excp)
{
TCGv tmp = new_tmp();
tcg_gen_movi_i32(tmp, excp);
gen_helper_exception(tmp);
dead_tmp(tmp);
}
| 19,708 |
FFmpeg | b12d92efd6c0d48665383a9baecc13e7ebbd8a22 | 1 | static int yop_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
AVPacket *avpkt)
{
YopDecContext *s = avctx->priv_data;
int tag, firstcolor, is_odd_frame;
int ret, i;
uint32_t *palette;
if (s->frame.data[0])
avctx->release_buffer(avctx, &s... | 19,710 |
FFmpeg | 301a24de52f5baa09beff0958327af2c2a7005dc | 1 | static int dnxhd_encode_picture(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data)
{
DNXHDEncContext *ctx = avctx->priv_data;
int first_field = 1;
int offset, i, ret;
if (buf_size < ctx->cid_table->frame_size) {
av_log(avctx, AV_LOG_ERROR, "output buffer is too small to compres... | 19,711 |
qemu | 4c315c27661502a0813b129e41c0bf640c34a8d6 | 1 | static void mb_cpu_class_init(ObjectClass *oc, void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
CPUClass *cc = CPU_CLASS(oc);
MicroBlazeCPUClass *mcc = MICROBLAZE_CPU_CLASS(oc);
mcc->parent_realize = dc->realize;
dc->realize = mb_cpu_realizefn;
mcc->parent_reset = cc->reset;
cc->reset = mb_... | 19,713 |
qemu | c6e7958eb76ed267f7254b97f89773874df50e48 | 1 | static int vfio_connect_container(VFIOGroup *group, AddressSpace *as,
Error **errp)
{
VFIOContainer *container;
int ret, fd;
VFIOAddressSpace *space;
space = vfio_get_address_space(as);
QLIST_FOREACH(container, &space->containers, next) {
if (!io... | 19,714 |
FFmpeg | 2caf19e90f270abe1e80a3e85acaf0eb5c9d0aac | 1 | static void FUNCC(pred4x4_top_dc)(uint8_t *_src, const uint8_t *topright, int _stride){
pixel *src = (pixel*)_src;
int stride = _stride/sizeof(pixel);
const int dc= ( src[-stride] + src[1-stride] + src[2-stride] + src[3-stride] + 2) >>2;
((pixel4*)(src+0*stride))[0]=
((pixel4*)(src+1*stride)... | 19,715 |
FFmpeg | 5c79d2e12d13959fc6aed92d102c25194a06de05 | 1 | static void print_report(int is_last_report, int64_t timer_start)
{
char buf[1024];
OutputStream *ost;
AVFormatContext *oc;
int64_t total_size;
AVCodecContext *enc;
int frame_number, vid, i;
double bitrate, ti1, pts;
static int64_t last_time = -1;
static int qp_histogram[52... | 19,717 |
FFmpeg | 6706a2986c48e3f20f1274b24345e6555d8f0f48 | 1 | static void store_slice_mmx(uint8_t *dst, const uint16_t *src,
int dst_stride, int src_stride,
int width, int height, int log2_scale,
const uint8_t dither[8][8])
{
int y;
for (y = 0; y < height; y++) {
uint8_t *... | 19,718 |
FFmpeg | 3228ac730c11eca49d5680d5550128e397061c85 | 1 | av_cold int ff_vc2enc_init_transforms(VC2TransformContext *s, int p_width, int p_height)
{
s->vc2_subband_dwt[VC2_TRANSFORM_9_7] = vc2_subband_dwt_97;
s->vc2_subband_dwt[VC2_TRANSFORM_5_3] = vc2_subband_dwt_53;
s->vc2_subband_dwt[VC2_TRANSFORM_HAAR] = vc2_subband_dwt_haar;
s->vc2_subband_dw... | 19,719 |
FFmpeg | 0023ea4e20b0bec70e1dedb7f1183dd58f9122d8 | 1 | static void fill_buffer(AVIOContext *s)
{
int max_buffer_size = s->max_packet_size ?
s->max_packet_size : IO_BUFFER_SIZE;
uint8_t *dst = s->buf_end - s->buffer + max_buffer_size < s->buffer_size ?
s->buf_end : s->buffer;
int len = ... | 19,720 |
FFmpeg | e83ffb48aca607ae3ec057f81c3d2eff9c075782 | 0 | static int apply_param_change(AVCodecContext *avctx, AVPacket *avpkt)
{
int size = 0, ret;
const uint8_t *data;
uint32_t flags;
data = av_packet_get_side_data(avpkt, AV_PKT_DATA_PARAM_CHANGE, &size);
if (!data)
return 0;
if (!(avctx->codec->capabilities & CODEC_CAP_PARAM_CHAN... | 19,722 |
FFmpeg | 4dbcdfa86d1405f7e5c0ec14a4be7d2fb5903d7b | 0 | static int get_number(void *obj, const char *name, const AVOption **o_out, double *num, int *den, int64_t *intnum)
{
const AVOption *o = av_opt_find(obj, name, NULL, 0, 0);
void *dst;
if (!o || o->offset<=0)
goto error;
dst= ((uint8_t*)obj) + o->offset;
if (o_out) *o_out= o;
... | 19,723 |
FFmpeg | 3b7ec920af42f1dc3676b72db9e617227c220436 | 0 | static int dts_probe(AVProbeData *p)
{
const uint8_t *buf, *bufp;
uint32_t state = -1;
int markers[4*16] = {0};
int exss_markers = 0, exss_nextpos = 0;
int sum, max, pos, i;
int64_t diff = 0;
uint8_t hdr[12 + AV_INPUT_BUFFER_PADDING_SIZE] = { 0 };
for (pos = FFMIN(4096, p->buf... | 19,726 |
FFmpeg | e584914acddaeb21f5258d9947b530fbd9421ab8 | 0 | static int wc3_read_packet(AVFormatContext *s,
AVPacket *pkt)
{
Wc3DemuxContext *wc3 = s->priv_data;
ByteIOContext *pb = s->pb;
unsigned int fourcc_tag;
unsigned int size;
int packet_read = 0;
int ret = 0;
unsigned char preamble[WC3_PREAMBLE_SIZE];
un... | 19,727 |
FFmpeg | 45286a625c6ced1f5c4c842244cbb4509429abba | 1 | int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup)
{
AVCodecContext *const avctx = h->avctx;
int err = 0;
h->mb_y = 0;
if (!in_setup && !h->droppable)
ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX,
h->picture_structure ==... | 19,729 |
qemu | efec3dd631d94160288392721a5f9c39e50fb2bc | 1 | static void pic_common_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
dc->vmsd = &vmstate_pic_common;
dc->no_user = 1;
dc->props = pic_properties_common;
dc->realize = pic_common_realize;
}
| 19,730 |
FFmpeg | 7ad742b2247a0d6f742a656892b4963fa77744dd | 1 | static AVFrame *alloc_frame(enum AVPixelFormat pixfmt, int w, int h)
{
AVFrame *frame = av_frame_alloc();
if (!frame)
return NULL;
frame->format = pixfmt;
frame->width = w;
frame->height = h;
if (av_frame_get_buffer(frame, 32) < 0)
return NULL;
return frame;
... | 19,731 |
qemu | 0d4104e5760221547fad158bbbb655a4e4c22b50 | 1 | void qdev_init_nofail(DeviceState *dev)
{
Error *err = NULL;
assert(!dev->realized);
object_property_set_bool(OBJECT(dev), true, "realized", &err);
if (err) {
error_reportf_err(err, "Initialization of device %s failed: ",
object_get_typename(OBJECT(dev)));
... | 19,732 |
qemu | 72902672dc2ed6281cdb205259c1d52ecf01f6b2 | 1 | static int disas_neon_data_insn(CPUState * env, DisasContext *s, uint32_t insn)
{
int op;
int q;
int rd, rn, rm;
int size;
int shift;
int pass;
int count;
int pairwise;
int u;
int n;
uint32_t imm, mask;
TCGv tmp, tmp2, tmp3, tmp4, tmp5;
TCGv_i64 tmp64;
... | 19,733 |
FFmpeg | 8cd1c0febe88b757e915e9af15559575c21ca728 | 1 | static av_cold int pcx_end(AVCodecContext *avctx) {
PCXContext *s = avctx->priv_data;
if(s->picture.data[0])
avctx->release_buffer(avctx, &s->picture);
return 0;
}
| 19,735 |
qemu | 9b2fadda3e0196ffd485adde4fe9cdd6fae35300 | 1 | static void gen_dccci(DisasContext *ctx)
{
#if defined(CONFIG_USER_ONLY)
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
#else
if (unlikely(ctx->pr)) {
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
return;
}
/* interpreted as no-op */
#endif
}
| 19,736 |
qemu | eb2f9b024d68884a3b25e63e4dbf90b67f8da236 | 1 | static void vmsvga_init(struct vmsvga_state_s *s,
MemoryRegion *address_space, MemoryRegion *io)
{
DisplaySurface *surface;
s->scratch_size = SVGA_SCRATCH_SIZE;
s->scratch = g_malloc(s->scratch_size * 4);
s->vga.con = graphic_console_init(vmsvga_update_display,
... | 19,737 |
FFmpeg | a4c32c9a63142b602820800742f2d543b58cd278 | 1 | static void init_frame_decoder(APEContext *ctx)
{
int i;
init_entropy_decoder(ctx);
init_predictor_decoder(ctx);
for (i = 0; i < APE_FILTER_LEVELS; i++) {
if (!ape_filter_orders[ctx->fset][i])
break;
init_filter(ctx, ctx->filters[i], ctx->filterbuf[i],
... | 19,738 |
qemu | 12848bfc5d719bad536c5448205a3226be1fda47 | 1 | static ssize_t local_readlink(FsContext *fs_ctx, const char *path,
char *buf, size_t bufsz)
{
ssize_t tsize = -1;
if (fs_ctx->fs_sm == SM_MAPPED) {
int fd;
fd = open(rpath(fs_ctx, path), O_RDONLY);
if (fd == -1) {
return -1;
}
do {
... | 19,739 |
qemu | 2928207ac1bb2751a1554ea0f9a9641179f51488 | 1 | static int dump_cleanup(DumpState *s)
{
int ret = 0;
guest_phys_blocks_free(&s->guest_phys_blocks);
memory_mapping_list_free(&s->list);
if (s->fd != -1) {
close(s->fd);
}
if (s->resume) {
vm_start();
}
return ret;
}
| 19,740 |
FFmpeg | aed84ee4d1b0c9e315a84b1ee0918fa49ee9cc09 | 1 | static int svq1_decode_block_intra(GetBitContext *bitbuf, uint8_t *pixels,
ptrdiff_t pitch)
{
uint32_t bit_cache;
uint8_t *list[63];
uint32_t *dst;
const uint32_t *codebook;
int entries[6];
int i, j, m, n;
int stages;
unsigned mean;
unsig... | 19,741 |
qemu | 84a3a53cf61ef691478bd91afa455c801696053c | 1 | static int omap2_intc_init(SysBusDevice *sbd)
{
DeviceState *dev = DEVICE(sbd);
struct omap_intr_handler_s *s = OMAP_INTC(dev);
if (!s->iclk) {
hw_error("omap2-intc: iclk not connected\n");
}
if (!s->fclk) {
hw_error("omap2-intc: fclk not connected\n");
}
s->level... | 19,742 |
FFmpeg | 1189af429211ac650aac730368a6cf5b23756605 | 1 | static int h264_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
H264Context *h = avctx->priv_data;
AVFrame *pict = data;
int buf_index = 0;
H264Pictur... | 19,743 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.