project
stringclasses
2 values
commit_id
stringlengths
40
40
target
int64
0
1
func
stringlengths
26
142k
idx
int64
0
27.3k
qemu
a5cf8262e4eb9c4646434e2c6211ef8608db3233
0
char* qdev_get_fw_dev_path(DeviceState *dev) { char path[128]; int l; l = qdev_get_fw_dev_path_helper(dev, path, 128); path[l-1] = '\0'; return strdup(path); }
21,494
qemu
a5068244b4f0c994791303b6186b6f732adab6c2
0
static ssize_t drop_sync(QIOChannel *ioc, size_t size) { ssize_t ret, dropped = size; char small[1024]; char *buffer; buffer = sizeof(small) < size ? small : g_malloc(MIN(65536, size)); while (size > 0) { ret = read_sync(ioc, buffer, MIN(65536, size)); if (ret < 0) { ...
21,495
qemu
61007b316cd71ee7333ff7a0a749a8949527575f
0
static BlockAIOCB *bdrv_aio_readv_em(BlockDriverState *bs, int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, BlockCompletionFunc *cb, void *opaque) { return bdrv_aio_rw_vector(bs, sector_num, qiov, nb_sectors, cb, opaque, 0); }
21,496
FFmpeg
36a60fad6215db39e9cd9523e3425f64464046c7
0
static int seek_frame_generic(AVFormatContext *s, int stream_index, int64_t timestamp, int flags) { int index; int64_t ret; AVStream *st; AVIndexEntry *ie; st = s->streams[stream_index]; index = av_index_search_timestamp(st, timestamp, flags); ...
21,497
FFmpeg
607ad990d31e6be52980970e5ce8cd25ab3de812
0
static void dvbsub_parse_page_segment(AVCodecContext *avctx, const uint8_t *buf, int buf_size) { DVBSubContext *ctx = avctx->priv_data; DVBSubRegionDisplay *display; DVBSubRegionDisplay *tmp_display_list, **tmp_ptr; const uint8_t *buf_end = buf + buf_size;...
21,498
qemu
bc7c08a2c375acb7ae4d433054415588b176d34c
0
static void test_qemu_strtoul_negative(void) { const char *str = " \t -321"; char f = 'X'; const char *endptr = &f; unsigned long res = 999; int err; err = qemu_strtoul(str, &endptr, 0, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, -321ul); g_assert(endp...
21,499
qemu
4a1418e07bdcfaa3177739e04707ecaec75d89e1
0
static int is_cpuid_supported(void) { return 1; }
21,500
qemu
8e9b0d24fb986d4241ae3b77752eca5dab4cb486
0
void vnc_display_init(const char *id) { VncDisplay *vs; if (vnc_display_find(id) != NULL) { return; } vs = g_malloc0(sizeof(*vs)); vs->id = strdup(id); QTAILQ_INSERT_TAIL(&vnc_displays, vs, next); vs->lsock = -1; #ifdef CONFIG_VNC_WS vs->lwebsock = -1; #endif ...
21,501
FFmpeg
e021eeb9f06f4f4d83690d07b47cdcc4172a61e1
0
static int get_key(const char **ropts, const char *delim, char *key, unsigned key_size) { unsigned key_pos = 0; const char *opts = *ropts; opts += strspn(opts, WHITESPACES); while (is_key_char(*opts)) { key[key_pos++] = *opts; if (key_pos == key_size) key_pos--; ...
21,502
FFmpeg
dbefbb61b785cd77810c032f5cdb499d2a92df07
0
static void expand_timestamps(void *log, struct sbg_script *s) { int i, nb_rel = 0; int64_t now, cur_ts, delta = 0; for (i = 0; i < s->nb_tseq; i++) nb_rel += s->tseq[i].ts.type == 'N'; if (nb_rel == s->nb_tseq) { /* All ts are relative to NOW: consider NOW = 0 */ now =...
21,503
FFmpeg
2bf4aa2e937737deb781706673f806d4388cf796
0
static void generate_len_table(uint8_t *dst, uint64_t *stats, int size){ heap_elem_t h[size]; int up[2*size]; int len[2*size]; int offset, i, next; for(offset=1; ; offset<<=1){ for(i=0; i<size; i++){ h[i].name = i; h[i].val = (stats[i] << 8) + offset; ...
21,504
FFmpeg
bdf7610eb266fd3de650040c97328791868abd82
0
static int scale_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame) { AVFilterContext *avctx = inlink->dst; AVFilterLink *outlink = avctx->outputs[0]; ScaleVAAPIContext *ctx = avctx->priv; AVFrame *output_frame = NULL; VASurfaceID input_surface, output_surface; VAProcPipelineP...
21,505
FFmpeg
0849a0ebb2c94856c3a94cb114a1412e44904c28
1
static int get_packet(URLContext *s, int for_header) { RTMPContext *rt = s->priv_data; int ret; uint8_t *p; const uint8_t *next; uint32_t data_size; uint32_t ts, cts, pts=0; if (rt->state == STATE_STOPPED) return AVERROR_EOF; for (;;) { RTMPPacket rpkt = { ...
21,506
FFmpeg
8de0990e9f22d7f728f70d5a03f3e78fc958f658
1
static void save_display_set(DVBSubContext *ctx) { DVBSubRegion *region; DVBSubRegionDisplay *display; DVBSubCLUT *clut; uint32_t *clut_table; int x_pos, y_pos, width, height; int x, y, y_off, x_off; uint32_t *pbuf; char filename[32]; static int fileno_index = 0; x_pos = -1; ...
21,507
FFmpeg
2b336df3cb9d9bcc12c4b398ea1dbdfe224d152e
1
int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen, void *log_ctx) { char *tail, color_string2[128]; const ColorEntry *entry; int len, hex_offset = 0; if (color_string[0] == '#') { hex_offset = 1; } else if (!strncmp(color_string, "0x", 2)...
21,509
qemu
71ae65e552fc6e03572e430009b98b80b40f1c4d
1
int i2c_start_transfer(I2CBus *bus, uint8_t address, int recv) { BusChild *kid; I2CSlaveClass *sc; I2CNode *node; if (address == 0x00) { /* * This is a broadcast, the current_devs will be all the devices of the * bus. */ bus->broadcast = true; ...
21,510
FFmpeg
e0c6cce44729d94e2a5507a4b6d031f23e8bd7b6
0
void ff_MPV_encode_init_x86(MpegEncContext *s) { int mm_flags = av_get_cpu_flags(); const int dct_algo = s->avctx->dct_algo; if (dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX) { #if HAVE_MMX_INLINE if (mm_flags & AV_CPU_FLAG_MMX && HAVE_MMX) s->dct_quantize = dct_quantize_MM...
21,512
qemu
9c5ce8db2e5c2769ed2fd3d91928dd1853b5ce7c
0
static void smbios_build_type_1_fields(void) { smbios_maybe_add_str(1, offsetof(struct smbios_type_1, manufacturer_str), type1.manufacturer); smbios_maybe_add_str(1, offsetof(struct smbios_type_1, product_name_str), type1.product); smbios_maybe_add_str...
21,514
qemu
fb2ef7919bd7b125a2ff6cb70689a7ab93b9d05a
0
static inline int mirror_clip_sectors(MirrorBlockJob *s, int64_t sector_num, int nb_sectors) { return MIN(nb_sectors, s->bdev_length / BDRV_SECTOR_SIZE - sector_num); }
21,515
qemu
f0afa73164778570083504a185d7498884c68d65
0
static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value) { uint32_t tag; uint32_t bufsize; uint32_t tot_len; size_t resplen; uint32_t tmp; value &= ~0xf; s->addr = value; tot_len = ldl_phys(&s->dma_as, value); /* @(addr + 4) : Buffer response ...
21,516
qemu
00e2ceae6c55bef40f5128a3e606f5c44351e0f9
0
ObjectClass *object_class_dynamic_cast(ObjectClass *class, const char *typename) { TypeImpl *target_type = type_get_by_name(typename); TypeImpl *type = class->type; ObjectClass *ret = NULL; if (type->num_interfaces && type_is_ancestor(target_type, type_inte...
21,517
qemu
d368ba4376b2c1c24175c74b3733b8fe64dbe8a6
0
static void sdhci_send_command(SDHCIState *s) { SDRequest request; uint8_t response[16]; int rlen; s->errintsts = 0; s->acmd12errsts = 0; request.cmd = s->cmdreg >> 8; request.arg = s->argument; DPRINT_L1("sending CMD%u ARG[0x%08x]\n", request.cmd, request.arg); rlen = sd...
21,518
qemu
4edebb0e8e14a5b934114b5ff74cb86437bb2532
0
static void ss5_init(int ram_size, int vga_ram_size, int boot_device, DisplayState *ds, const char **fd_filename, int snapshot, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model) { if ...
21,519
qemu
435db4cf29b88b6612e30acda01cd18788dff458
0
const char *qemu_opt_get(QemuOpts *opts, const char *name) { QemuOpt *opt = qemu_opt_find(opts, name); if (!opt) { const QemuOptDesc *desc = find_desc_by_name(opts->list->desc, name); if (desc && desc->def_value_str) { return desc->def_value_str; } } return...
21,520
qemu
cd48d7e8f322cdb05692b023b168816ed6306fc4
0
void qemu_mod_timer(QEMUTimer *ts, int64_t expire_time) { QEMUTimer **pt, *t; qemu_del_timer(ts); /* add the timer in the sorted list */ /* NOTE: this code must be signal safe because qemu_timer_expired() can be called from a signal. */ pt = &active_timers[ts->clock->type]; fo...
21,521
qemu
9abc62f6445795522d1bf5bf17f642e44eaf032d
0
static void qemu_system_suspend(void) { pause_all_vcpus(); notifier_list_notify(&suspend_notifiers, NULL); runstate_set(RUN_STATE_SUSPENDED); monitor_protocol_event(QEVENT_SUSPEND, NULL); is_suspended = true; }
21,522
FFmpeg
13a099799e89a76eb921ca452e1b04a7a28a9855
0
static void RENAME(yuv2rgb565_1)(SwsContext *c, const uint16_t *buf0, const uint16_t *ubuf0, const uint16_t *ubuf1, const uint16_t *vbuf0, const uint16_t *vbuf1, const uint16_t *abuf0, uint8_t *dest, ...
21,523
qemu
c881e20eed4911ab6f8c674f2b1bf225a2cdde71
0
static void numa_node_parse_cpus(int nodenr, const char *cpus) { char *endptr; unsigned long long value, endvalue; value = strtoull(cpus, &endptr, 10); if (*endptr == '-') { endvalue = strtoull(endptr+1, &endptr, 10); } else { endvalue = value; } if (!(endvalue ...
21,524
qemu
e76d1798faa6d29f54c0930a034b67f3ecdb947d
0
static void icount_dummy_timer(void *opaque) { (void)opaque; }
21,525
qemu
d6478bc7e92db4669fac701d7bb8c51756b61d8a
0
static int gdb_set_float_reg(CPUPPCState *env, uint8_t *mem_buf, int n) { if (n < 32) { env->fpr[n] = ldfq_p(mem_buf); return 8; } if (n == 32) { /* FPSCR not implemented */ return 4; } return 0; }
21,526
qemu
a5086f95421e43c7b9e1b28a111aae0be4848117
0
static inline void decode(DisasContext *dc) { uint32_t ir; int i; if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_OP))) { tcg_gen_debug_insn_start(dc->pc); } dc->ir = ir = ldl_code(dc->pc); LOG_DIS("%8.8x\t", dc->ir); /* try guessing 'empty' instruction memory, although it ...
21,527
qemu
cdb3081269347fd9271fd1b7a9df312e2953bdd9
0
void memory_region_init_iommu(MemoryRegion *mr, Object *owner, const MemoryRegionIOMMUOps *ops, const char *name, uint64_t size) { memory_region_init(mr, owner, name, size); mr->iommu_o...
21,528
qemu
d0052339236072bbf08c1d600c0906126b1ab258
0
void helper_movl_drN_T0(CPUX86State *env, int reg, target_ulong t0) { #ifndef CONFIG_USER_ONLY if (reg < 4) { if (hw_breakpoint_enabled(env->dr[7], reg) && hw_breakpoint_type(env->dr[7], reg) != DR7_TYPE_IO_RW) { hw_breakpoint_remove(env, reg); env->dr[reg] = t0; ...
21,529
qemu
55e1819c509b3d9c10a54678b9c585bbda13889e
0
QDict *qdict_new(void) { QDict *qdict; qdict = g_malloc0(sizeof(*qdict)); QOBJECT_INIT(qdict, &qdict_type); return qdict; }
21,530
qemu
4341df8a83d6a528a1e2855735f87fc3aab42b70
0
int qcow2_get_cluster_offset(BlockDriverState *bs, uint64_t offset, unsigned int *bytes, uint64_t *cluster_offset) { BDRVQcow2State *s = bs->opaque; unsigned int l2_index; uint64_t l1_index, l2_offset, *l2_table; int l1_bits, c; unsigned int offset_in_cluster; ...
21,532
qemu
0ae18ceeaaa2c1749e742c4b112f6c3bf0896408
0
mips_mipssim_init (ram_addr_t ram_size, int vga_ram_size, const char *boot_device, DisplayState *ds, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model) { char buf[1024]; unsigned long bios_of...
21,533
FFmpeg
d1adad3cca407f493c3637e20ecd4f7124e69212
0
static inline void RENAME(LEToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, long width, uint32_t *unused) { #if COMPILE_TEMPLATE_MMX __asm__ volatile( "mov %0, %%"REG_a" \n\t" "1: \n\t" "movq...
21,534
qemu
a8170e5e97ad17ca169c64ba87ae2f53850dab4c
0
static target_phys_addr_t intel_hda_addr(uint32_t lbase, uint32_t ubase) { target_phys_addr_t addr; addr = ((uint64_t)ubase << 32) | lbase; return addr; }
21,535
qemu
298a1665a2800f7264e483c2dd1f551574243a2f
0
static BlockMeasureInfo *qcow2_measure(QemuOpts *opts, BlockDriverState *in_bs, Error **errp) { Error *local_err = NULL; BlockMeasureInfo *info; uint64_t required = 0; /* bytes that contribute to required size */ uint64_t virtual_size; /* disk size as seen by...
21,536
qemu
3c529d935923a70519557d420db1d5a09a65086a
0
static void raw_aio_cancel(BlockDriverAIOCB *blockacb) { int ret; RawAIOCB *acb = (RawAIOCB *)blockacb; RawAIOCB **pacb; ret = aio_cancel(acb->aiocb.aio_fildes, &acb->aiocb); if (ret == AIO_NOTCANCELED) { /* fail safe: if the aio could not be canceled, we wait for it */ ...
21,537
qemu
64c7b9d8e07936383db181876b59c597d6a1ff69
0
void check_file_fixed_eof_mmaps(void) { char *addr; char *cp; unsigned int *p1; uintptr_t p; int i; /* Find a suitable address to start with. */ addr = mmap(NULL, pagesize * 44, PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); fprintf (stderr, "%s addr=%p", __func__, (void *)addr); ...
21,539
qemu
f53a829bb9ef14be800556cbc02d8b20fc1050a7
0
static void nbd_attach_aio_context(BlockDriverState *bs, AioContext *new_context) { BDRVNBDState *s = bs->opaque; nbd_client_session_attach_aio_context(&s->client, new_context); }
21,540
qemu
2860e3eb9695d7596507e82b98074937fbd7fa18
0
void bmdma_cmd_writeb(void *opaque, uint32_t addr, uint32_t val) { BMDMAState *bm = opaque; #ifdef DEBUG_IDE printf("%s: 0x%08x\n", __func__, val); #endif /* Ignore writes to SSBM if it keeps the old value */ if ((val & BM_CMD_START) != (bm->cmd & BM_CMD_START)) { if (!(val & BM_CMD_ST...
21,541
qemu
909a196d2754388d3b15a34b688095c655792124
0
uint32_t qemu_devtree_get_phandle(void *fdt, const char *path) { uint32_t r; r = fdt_get_phandle(fdt, findnode_nofail(fdt, path)); if (r <= 0) { fprintf(stderr, "%s: Couldn't get phandle for %s: %s\n", __func__, path, fdt_strerror(r)); exit(1); } return r...
21,542
qemu
bd269ebc82fbaa5fe7ce5bc7c1770ac8acecd884
0
static char *SocketAddress_to_str(const char *prefix, SocketAddressLegacy *addr, bool is_listen, bool is_telnet) { switch (addr->type) { case SOCKET_ADDRESS_LEGACY_KIND_INET: return g_strdup_printf("%s%s:%s:%s%s", prefix, is_telnet ?...
21,543
qemu
3ebcc707d20643e9fefa24a4396de577b1163755
0
void handle_vm86_fault(CPUX86State *env) { TaskState *ts = env->opaque; uint8_t *csp, *pc, *ssp; unsigned int ip, sp, newflags, newip, newcs, opcode, intno; int data32, pref_done; csp = (uint8_t *)(env->segs[R_CS] << 4); ip = env->eip & 0xffff; pc = csp + ip; ssp = (uint...
21,544
qemu
8150847061f8d2606101bfff77cc6ec86b081ab0
0
static MemTxResult gic_cpu_write(GICState *s, int cpu, int offset, uint32_t value, MemTxAttrs attrs) { switch (offset) { case 0x00: /* Control */ gic_set_cpu_control(s, cpu, value, attrs); break; case 0x04: /* Priority mask */ s->priority_mask...
21,545
qemu
25c4d9cc845fb58f624dae8c0f690e20c70e7a1d
0
static int op_to_movi(int op) { switch (op_bits(op)) { case 32: return INDEX_op_movi_i32; #if TCG_TARGET_REG_BITS == 64 case 64: return INDEX_op_movi_i64; #endif default: fprintf(stderr, "op_to_movi: unexpected return value of " "function op_bits.\n"); ...
21,546
qemu
ad674e53b5cce265fadafbde2c6a4f190345cd00
0
static void dbdma_end(DBDMA_io *io) { DBDMA_channel *ch = io->channel; dbdma_cmd *current = &ch->current; if (conditional_wait(ch)) goto wait; current->xfer_status = cpu_to_le16(be32_to_cpu(ch->regs[DBDMA_STATUS])); current->res_count = cpu_to_le16(be32_to_cpu(io->len)); dbdm...
21,547
qemu
37d1e4d9bfac846a1331375aab3d13b54a048c01
0
static void nfs_process_read(void *arg) { NFSClient *client = arg; aio_context_acquire(client->aio_context); nfs_service(client->context, POLLIN); nfs_set_events(client); aio_context_release(client->aio_context); }
21,548
qemu
fa7d1867578b6a1afc39d4ece8629a1e92baddd7
0
int qemu_init_main_loop(void) { int ret; qemu_init_sigbus(); ret = qemu_signal_init(); if (ret) { return ret; } /* Note eventfd must be drained before signalfd handlers run */ ret = qemu_event_init(); if (ret) { return ret; } qemu_cond_init(&q...
21,550
qemu
5858dd1801883309bdd208d72ddb81c4e9fee30c
0
static bool blit_is_unsafe(struct CirrusVGAState *s, bool dst_only) { /* should be the case, see cirrus_bitblt_start */ assert(s->cirrus_blt_width > 0); assert(s->cirrus_blt_height > 0); if (s->cirrus_blt_width > CIRRUS_BLTBUFSIZE) { return true; } if (blit_region_is_unsafe(s...
21,551
qemu
6acbe4c6f18e7de00481ff30574262b58526de45
0
static void virtio_pci_register_devices(void) { type_register_static(&virtio_blk_info); type_register_static_alias(&virtio_blk_info, "virtio-blk"); type_register_static(&virtio_net_info); type_register_static_alias(&virtio_net_info, "virtio-net"); type_register_static(&virtio_serial_info); ...
21,552
qemu
45db7ba681ede57113a67499840e69ee586bcdf2
0
static MemTxResult nvic_sysreg_read(void *opaque, hwaddr addr, uint64_t *data, unsigned size, MemTxAttrs attrs) { NVICState *s = (NVICState *)opaque; uint32_t offset = addr; unsigned i, startvec, end; uint32_t val; if ...
21,553
qemu
d045c466d9e62b4321fadf586d024d54ddfd8bd4
0
coroutine_fn iscsi_co_pdiscard(BlockDriverState *bs, int64_t offset, int count) { IscsiLun *iscsilun = bs->opaque; struct IscsiTask iTask; struct unmap_list list; if (!is_byte_request_lun_aligned(offset, count, iscsilun)) { return -ENOTSUP; } if (!iscsilun->lbp.lbpu) { ...
21,554
qemu
30fd3e27907dfd1c0c66cc1339657af1a2ce1d4b
0
static ssize_t qio_channel_command_writev(QIOChannel *ioc, const struct iovec *iov, size_t niov, int *fds, size_t nfds, ...
21,556
qemu
364031f17932814484657e5551ba12957d993d7e
0
static void v9fs_synth_fill_statbuf(V9fsSynthNode *node, struct stat *stbuf) { stbuf->st_dev = 0; stbuf->st_ino = node->attr->inode; stbuf->st_mode = node->attr->mode; stbuf->st_nlink = node->attr->nlink; stbuf->st_uid = 0; stbuf->st_gid = 0; stbuf->st_rdev = 0; stbuf->st_size =...
21,557
qemu
72cf2d4f0e181d0d3a3122e04129c58a95da713e
0
void cpu_exec_init(CPUState *env) { CPUState **penv; int cpu_index; #if defined(CONFIG_USER_ONLY) cpu_list_lock(); #endif env->next_cpu = NULL; penv = &first_cpu; cpu_index = 0; while (*penv != NULL) { penv = &(*penv)->next_cpu; cpu_index++; } env->cpu...
21,558
qemu
d368ba4376b2c1c24175c74b3733b8fe64dbe8a6
0
static void sdhci_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); SDHCIClass *k = SDHCI_CLASS(klass); dc->vmsd = &sdhci_vmstate; dc->props = sdhci_properties; dc->reset = sdhci_generic_reset; dc->realize = sdhci_realize; k->reset = sdhci_reset;...
21,559
qemu
caae6c961107c4c55731a86572f9a1f53837636b
0
static void ppc_heathrow_init(MachineState *machine) { ram_addr_t ram_size = machine->ram_size; const char *cpu_model = machine->cpu_model; const char *kernel_filename = machine->kernel_filename; const char *kernel_cmdline = machine->kernel_cmdline; const char *initrd_filename = machine->initr...
21,560
FFmpeg
b8b13acd70a1c1b6c044f967d78cb82f1a53887b
0
static void hls_decode_neighbour(HEVCContext *s, int x_ctb, int y_ctb, int ctb_addr_ts) { HEVCLocalContext *lc = &s->HEVClc; int ctb_size = 1 << s->ps.sps->log2_ctb_size; int ctb_addr_rs = s->ps.pps->ctb_addr_ts_to_rs[ctb_addr_ts]; int ctb_addr_in_s...
21,562
qemu
fb7b5c0df6e3c501973ce4d57eb2b1d4344a519d
0
static void scsi_qdev_unrealize(DeviceState *qdev, Error **errp) { SCSIDevice *dev = SCSI_DEVICE(qdev); if (dev->vmsentry) { qemu_del_vm_change_state_handler(dev->vmsentry); } scsi_device_unrealize(dev, errp); }
21,563
qemu
3996e85c1822e05c50250f8d2d1e57b6bea1229d
1
static void xen_set_memory(struct MemoryListener *listener, MemoryRegionSection *section, bool add) { XenIOState *state = container_of(listener, XenIOState, memory_listener); hwaddr start_addr = section->offset_within_address_space; ram_addr_t size...
21,565
qemu
21f88d021d0d2b4ecee8f6cd6ca63a943a3ce71d
1
opts_check_list(Visitor *v, Error **errp) { /* * FIXME should set error when unvisited elements remain. Mostly * harmless, as the generated visits always visit all elements. */ }
21,566
FFmpeg
ca4a3f4a08de04344e5cb16b506564969a43ed7e
1
static int vorbis_packet(AVFormatContext *s, int idx) { struct ogg *ogg = s->priv_data; struct ogg_stream *os = ogg->streams + idx; struct oggvorbis_private *priv = os->private; int duration; /* first packet handling here we parse the duration of each packet in the first page and com...
21,568
qemu
96bdbbab55976b106f9db2b61042ebf5f0493e5a
1
static int32_t scsi_disk_dma_command(SCSIRequest *req, uint8_t *buf) { SCSIDiskReq *r = DO_UPCAST(SCSIDiskReq, req, req); SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, req->dev); int32_t len; uint8_t command; command = buf[0]; if (s->tray_open || !bdrv_is_inserted(s->qdev.conf.bs)...
21,570
qemu
c4237dfa635900e4d1cdc6038d5efe3507f45f0c
1
static void coroutine_fn mirror_run(void *opaque) { MirrorBlockJob *s = opaque; MirrorExitData *data; BlockDriverState *bs = s->common.bs; int64_t sector_num, end, sectors_per_chunk, length; uint64_t last_pause_ns; BlockDriverInfo bdi; char backing_filename[1024]; int ret = 0; ...
21,571
qemu
976620ac4018db142d82cd42bb7774f40290ce7e
1
int object_property_get_enum(Object *obj, const char *name, const char *strings[], Error **errp) { StringOutputVisitor *sov; StringInputVisitor *siv; int ret; sov = string_output_visitor_new(false); object_property_get(obj, string_output_get_visitor(sov), name, ...
21,572
FFmpeg
8813d55fa5978660d9f4e7dbe1f50da9922be08d
0
int ff_vaapi_render_picture(FFVAContext *vactx, VASurfaceID surface) { VABufferID va_buffers[3]; unsigned int n_va_buffers = 0; if (!vactx->pic_param_buf_id) return 0; vaUnmapBuffer(vactx->display, vactx->pic_param_buf_id); va_buffers[n_va_buffers++] = vactx->pic_param_buf_id; ...
21,573
FFmpeg
aaa995d7f29cba39b1fe05b6f0a807bfc7a09f43
0
static void loop_filter(H264Context *h){ MpegEncContext * const s = &h->s; uint8_t *dest_y, *dest_cb, *dest_cr; int linesize, uvlinesize, mb_x, mb_y; const int end_mb_y= s->mb_y + FRAME_MBAFF; const int old_slice_type= h->slice_type; if(h->deblocking_filter) { for(mb_x= 0; mb_x...
21,574
FFmpeg
28e6b7b9b4e0a6ec05575cffedd56e1319f8691f
0
static int mov_write_tfhd_tag(AVIOContext *pb, MOVTrack *track, int64_t moof_offset) { int64_t pos = avio_tell(pb); uint32_t flags = MOV_TFHD_DEFAULT_SIZE | MOV_TFHD_DEFAULT_DURATION | MOV_TFHD_BASE_DATA_OFFSET; if (!track->entry) { flags |= ...
21,575
FFmpeg
323e6fead07c75f418e4b60704a4f437bb3483b2
1
static int normalize_samples(AC3EncodeContext *s) { int v = 14 - log2_tab(s, s->windowed_samples, AC3_WINDOW_SIZE); lshift_tab(s->windowed_samples, AC3_WINDOW_SIZE, v); return v - 9; }
21,577
qemu
8d04fb55dec381bc5105cb47f29d918e579e8cbd
1
uint32_t HELPER(servc)(CPUS390XState *env, uint64_t r1, uint64_t r2) { int r = sclp_service_call(env, r1, r2); if (r < 0) { program_interrupt(env, -r, 4); return 0; } return r; }
21,578
qemu
5e39d89d20b17cf6fb7f09d181d34f17b2ae2160
1
static void test_query_cpus(const void *data) { char *cli; QDict *resp; QList *cpus; const QObject *e; cli = make_cli(data, "-smp 8 -numa node,cpus=0-3 -numa node,cpus=4-7"); qtest_start(cli); cpus = get_cpus(&resp); g_assert(cpus); while ((e = qlist_pop(cpus))) { ...
21,579
qemu
e3c9d76acc984218264bbc6435b0c09f959ed9b8
1
int virtio_scsi_common_exit(VirtIOSCSICommon *vs) { VirtIODevice *vdev = VIRTIO_DEVICE(vs); g_free(vs->cmd_vqs); virtio_cleanup(vdev); return 0; }
21,580
FFmpeg
3d23f7a0969bf76ad6dcdc2c4a5cd3ae884745a8
1
static int decode_subframe_fixed(FLACContext *s, int32_t *decoded, int pred_order, int bps) { const int blocksize = s->blocksize; unsigned av_uninit(a), av_uninit(b), av_uninit(c), av_uninit(d); int i; int ret; /* warm up samples */ for (i = 0; i < pred...
21,581
FFmpeg
0e3afacd4d8fbe1c21e0bc16bd707809cd87380f
0
static int add_tonal_components(float *spectrum, int num_components, TonalComponent *components) { int i, j, last_pos = -1; float *input, *output; for (i = 0; i < num_components; i++) { last_pos = FFMAX(components[i].pos + components[i].num_coefs, last_pos); ...
21,582
qemu
60fe637bf0e4d7989e21e50f52526444765c63b4
1
static int qemu_rdma_write_flush(QEMUFile *f, RDMAContext *rdma) { int ret; if (!rdma->current_length) { return 0; } ret = qemu_rdma_write_one(f, rdma, rdma->current_index, rdma->current_addr, rdma->current_length); if (ret < 0) { return ret; } ...
21,588
qemu
1e0228fd20aa46ac1f02cffee946cdd4ffaf8b96
1
Exynos4210State *exynos4210_init(MemoryRegion *system_mem, unsigned long ram_size) { int i, n; Exynos4210State *s = g_new(Exynos4210State, 1); qemu_irq gate_irq[EXYNOS4210_NCPUS][EXYNOS4210_IRQ_GATE_NINPUTS]; unsigned long mem_size; DeviceState *dev; SysBusDevice *busdev; ObjectClass...
21,590
qemu
bd88c780e6a17188f7fd676f3a056e5db21500e0
1
static void *clone_func(void *arg) { new_thread_info *info = arg; CPUArchState *env; CPUState *cpu; TaskState *ts; rcu_register_thread(); env = info->env; cpu = ENV_GET_CPU(env); thread_cpu = cpu; ts = (TaskState *)cpu->opaque; info->tid = gettid(); cpu->host_ti...
21,591
FFmpeg
009f829dde811af654af7110326aea3a72c05d5e
1
static inline void RENAME(yuv2rgb32_1)(SwsContext *c, const uint16_t *buf0, const uint16_t *ubuf0, const uint16_t *ubuf1, const uint16_t *vbuf0, const uint16_t *vbuf1, const uint16_t *abuf0, uint8_t *...
21,592
qemu
fcf73f66a67f5e58c18216f8c8651e38cf4d90af
1
QInt *qobject_to_qint(const QObject *obj) { if (qobject_type(obj) != QTYPE_QINT) return NULL; return container_of(obj, QInt, base); }
21,593
FFmpeg
56706ac0d5723cb549fec2602e798ab1bf6004cd
1
static int libopenjpeg_copy_packed8(AVCodecContext *avctx, const AVFrame *frame, opj_image_t *image) { int compno; int x; int y; int *image_line; int frame_index; const int numcomps = image->numcomps; for (compno = 0; compno < numcomps; ++compno) { if (image->comps[compno]...
21,594
qemu
9a321e92343891e30f6fe8bfaad40454ae358bfb
1
static int spapr_msicfg_find(sPAPRPHBState *phb, uint32_t config_addr, bool alloc_new) { int i; for (i = 0; i < SPAPR_MSIX_MAX_DEVS; ++i) { if (!phb->msi_table[i].nvec) { break; } if (phb->msi_table[i].config_addr == config_addr) { ...
21,595
qemu
b47b35250fbfa062aedf6ab6e5faab84c4a76f4f
1
static void fdctrl_connect_drives(FDCtrl *fdctrl) { unsigned int i; FDrive *drive; for (i = 0; i < MAX_FD; i++) { drive = &fdctrl->drives[i]; fd_init(drive); fd_revalidate(drive); if (drive->bs) { bdrv_set_removable(drive->bs, 1); } } }...
21,596
FFmpeg
dcc39ee10e82833ce24aa57926c00ffeb1948198
0
static av_cold int decode_init(AVCodecContext *avctx) { ASV1Context *const a = avctx->priv_data; const int scale = avctx->codec_id == AV_CODEC_ID_ASV1 ? 1 : 2; int i; if (avctx->extradata_size < 1) { av_log(avctx, AV_LOG_ERROR, "No extradata provided\n"); return AVERROR_INV...
21,597
FFmpeg
94e86ae15a4328b22f6f103b9fd9b6a9ee0c676c
0
int ff_mjpeg_decode_sos(MJpegDecodeContext *s, const uint8_t *mb_bitmask, const AVFrame *reference) { int len, nb_components, i, h, v, predictor, point_transform; int index, id, ret; const int block_size = s->lossless ? 1 : 8; int ilv, prev_shift; if (!s->got_picture...
21,598
FFmpeg
3c895fc098f7637f6d5ec3a9d6766e724a8b9e41
0
static void do_video_out(AVFormatContext *s, AVOutputStream *ost, AVInputStream *ist, AVFrame *in_picture, int *frame_size, AVOutputStream *audio_sync) { int nb_frames, i, ret; AVFrame *final_picture, *f...
21,599
FFmpeg
a4f6be86d67ae30d494fbe8a470bc32b715d75a9
0
static void av_always_inline filter_mb_edgecv( uint8_t *pix, int stride, const int16_t bS[4], unsigned int qp, H264Context *h ) { const int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8); const unsigned int index_a = qp - qp_bd_offset + h->slice_alpha_c0_offset; const int alpha = alpha_table[index_a]; ...
21,600
FFmpeg
87e302bfd8ffbc6cdb20920029013956b10ace63
0
int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; MpegEncContext *s = avctx->priv_data; int ret; AVFrame *pict = data; #ifde...
21,602
FFmpeg
2636e691ce5347756a2c05b3105b0277c1b9acb4
0
static int transcode_video(InputStream *ist, AVPacket *pkt, int *got_output, int64_t *pkt_pts) { AVFrame *decoded_frame, *filtered_frame = NULL; void *buffer_to_free = NULL; int i, ret = 0; float quality; #if CONFIG_AVFILTER int frame_available = 1; #endif if (!ist->decoded_frame && !...
21,603
FFmpeg
2875745d354ab0ebc4af1ebaca5c5a8d26ccdc03
0
enum AVCodecID ff_get_pcm_codec_id(int bps, int flt, int be, int sflags) { if (bps > 64U) return AV_CODEC_ID_NONE; if (flt) { switch (bps) { case 32: return be ? AV_CODEC_ID_PCM_F32BE : AV_CODEC_ID_PCM_F32LE; case 64: return be ? AV_CODEC_ID_PCM...
21,604
FFmpeg
fe91becc2dcf32fc4bc56b00b4533d34ec3d27f5
0
static int synthfilt_build_sb_samples (QDM2Context *q, GetBitContext *gb, int length, int sb_min, int sb_max) { int sb, j, k, n, ch, run, channels; int joined_stereo, zero_encoding, chs; int type34_first; float type34_div = 0; float type34_predictor; float samples[10], sign_bits[16]; ...
21,605
FFmpeg
e3331706fcc9888ee85f0b9f763e4d006b178c14
0
static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) { PadContext *pad = inlink->dst->priv; AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0); int plane; inlink->dst->outputs[0]->out_buf = outpicref; for (plane = 0; plane < 4 && outpicref->data[plane]; ...
21,606
FFmpeg
b12d21733975f9001eecb480fc28e5e4473b1327
0
static int thread_init(AVCodecContext *avctx) { int i; ThreadContext *c; int thread_count = avctx->thread_count; if (!thread_count) { int nb_cpus = get_logical_cpus(avctx); // use number of cores + 1 as thread count if there is motre than one if (nb_cpus > 1) ...
21,608
FFmpeg
dcd3418a35aab7ef283b68ed9997ce4ac204094e
0
static av_cold int vtenc_init(AVCodecContext *avctx) { CFMutableDictionaryRef enc_info; CFMutableDictionaryRef pixel_buffer_info; CMVideoCodecType codec_type; VTEncContext *vtctx = avctx->priv_data; CFStringRef profile_level; CFBooleanRef has_b_frames_...
21,609
FFmpeg
550bda741cfe0e471a70e40529a9ab02d31b7049
1
av_cold void ff_dsputil_init_alpha(DSPContext *c, AVCodecContext *avctx) { const int high_bit_depth = avctx->bits_per_raw_sample > 8; /* amask clears all bits that correspond to present features. */ if (amask(AMASK_MVI) == 0) { c->put_pixels_clamped = put_pixels_clamped_mvi_asm; c->...
21,610
FFmpeg
b2be76c0a472b729756ed7a91225c209d0dd1d2e
1
static av_always_inline int dnxhd_decode_dct_block(const DNXHDContext *ctx, RowContext *row, int n, int index_bits, ...
21,611
qemu
f5855994fee2f8815dc86b8453e4a63e290aea05
0
static void pci_write(void *opaque, hwaddr addr, uint64_t data, unsigned int size) { AcpiPciHpState *s = opaque; switch (addr) { case PCI_EJ_BASE: if (s->hotplug_select >= ACPI_PCIHP_MAX_HOTPLUG_BUS) { break; } acpi_pcihp_eject_slot(s, s->ho...
21,613
qemu
f17fd4fdf0df3d2f3444399d04c38d22b9a3e1b7
0
int64_t qemu_strtosz(const char *nptr, char **end) { return do_strtosz(nptr, end, 'B', 1024); }
21,614