project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | 482f7bf86b43af9f6903c52726fedf82b28bf953 | 1 | static void select_vgahw (const char *p)
{
const char *opts;
vga_interface_type = VGA_NONE;
if (strstart(p, "std", &opts)) {
if (vga_available()) {
vga_interface_type = VGA_STD;
fprintf(stderr, "Error: standard VGA not available\n");
exit(0);
} else if (strsta... | 1,597 |
qemu | 7005f7f81cef31bda895d3274c13854c143d3d8d | 1 | void kvm_irqchip_commit_routes(KVMState *s)
{
int ret;
s->irq_routes->flags = 0;
trace_kvm_irqchip_commit_routes();
ret = kvm_vm_ioctl(s, KVM_SET_GSI_ROUTING, s->irq_routes);
assert(ret == 0); | 1,598 |
qemu | 027d9a7d2911e993cdcbd21c7c35d1dd058f05bb | 1 | void cpu_exit(CPUState *cpu)
{
cpu->exit_request = 1;
/* Ensure cpu_exec will see the exit request after TCG has exited. */
smp_wmb();
cpu->tcg_exit_req = 1;
}
| 1,599 |
FFmpeg | c23acbaed40101c677dfcfbbfe0d2c230a8e8f44 | 1 | void FUNCC(ff_h264_idct8_add)(uint8_t *_dst, DCTELEM *_block, int stride){
int i;
INIT_CLIP
pixel *dst = (pixel*)_dst;
dctcoef *block = (dctcoef*)_block;
stride /= sizeof(pixel);
block[0] += 32;
for( i = 0; i < 8; i++ )
{
const int a0 = block[i+0*8] + block[i+4*8];
... | 1,600 |
FFmpeg | 5ea59b1f424f0efc7805d837e6fdb80561fb0f3a | 1 | static int huf_decode(const uint64_t *hcode, const HufDec *hdecod,
GetByteContext *gb, int nbits,
int rlc, int no, uint16_t *out)
{
uint64_t c = 0;
uint16_t *outb = out;
uint16_t *oe = out + no;
const uint8_t *ie = gb->buffer + (nbits + 7... | 1,601 |
qemu | f31b035a9f10dc9b57f01c426110af845d453ce2 | 0 | static void gen_mfc0(DisasContext *ctx, TCGv arg, int reg, int sel)
{
const char *rn = "invalid";
if (sel != 0)
check_insn(ctx, ISA_MIPS32);
switch (reg) {
case 0:
switch (sel) {
case 0:
gen_mfc0_load32(arg, offsetof(CPUMIPSState, CP0_Index));
... | 1,602 |
qemu | ef5a788527b2038d742b057a415ab4d0e735e98f | 0 | static int64_t cvtnum(const char *s)
{
char *end;
return qemu_strtosz_suffix(s, &end, QEMU_STRTOSZ_DEFSUFFIX_B);
}
| 1,603 |
qemu | 8360544a6d3a54df1fce80f55ba4ad075a8ded54 | 0 | static void qpci_spapr_io_writeb(QPCIBus *bus, void *addr, uint8_t value)
{
QPCIBusSPAPR *s = container_of(bus, QPCIBusSPAPR, bus);
uint64_t port = (uintptr_t)addr;
if (port < s->pio.size) {
writeb(s->pio_cpu_base + port, value);
} else {
writeb(s->mmio_cpu_base + port, value);
... | 1,604 |
qemu | 8a5956ad6392f115521dad774055c737c49fb0dd | 0 | static void *rcu_q_updater(void *arg)
{
int j, target_el;
long long n_updates_local = 0;
long long n_removed_local = 0;
struct list_element *el, *prev_el;
*(struct rcu_reader_data **)arg = &rcu_reader;
atomic_inc(&nthreadsrunning);
while (goflag == GOFLAG_INIT) {
g_usleep(... | 1,605 |
FFmpeg | 1bbeb06a36ec36ce03e1c882c8e97efdc13c9a9b | 0 | int Configure(void **ctxp, int argc, char *argv[])
{
ContextInfo *ci;
int c;
*ctxp = av_mallocz(sizeof(ContextInfo));
ci = (ContextInfo *) *ctxp;
optind = 1;
ci->dir = "/tmp";
ci->threshold = 100;
ci->file_limit = 100;
ci->min_interval = 1000000;
ci->inset = 10; ... | 1,606 |
qemu | f7613bee32ebd13ff4a8d721a59cf27b1fe5d94b | 0 | static int local_chown(FsContext *ctx, const char *path, uid_t uid, gid_t gid)
{
return chown(rpath(ctx, path), uid, gid);
}
| 1,607 |
qemu | cbc0326b6fb905f80b7cef85b24571f7ebb62077 | 0 | static void disas_arm_insn(DisasContext *s, unsigned int insn)
{
unsigned int cond, val, op1, i, shift, rm, rs, rn, rd, sh;
TCGv_i32 tmp;
TCGv_i32 tmp2;
TCGv_i32 tmp3;
TCGv_i32 addr;
TCGv_i64 tmp64;
/* M variants do not implement ARM mode. */
if (arm_dc_feature(s, ARM_FEATURE... | 1,610 |
qemu | 2c6942fa7b332a95286071b92d233853e1000948 | 0 | int64_t bdrv_getlength(BlockDriverState *bs)
{
BlockDriver *drv = bs->drv;
if (!drv)
return -ENOMEDIUM;
if (bs->growable || bs->removable) {
if (drv->bdrv_getlength) {
return drv->bdrv_getlength(bs);
}
}
return bs->total_sectors * BDRV_SECTOR_SIZE;
}
| 1,611 |
qemu | 2f84a92ec631f5907207990705a22afb9aad3eef | 0 | static void test_after_failed_device_add(void)
{
QDict *response;
QDict *error;
qtest_start("-drive if=none,id=drive0");
/* Make device_add fail. If this leaks the virtio-blk-pci device then a
* reference to drive0 will also be held (via qdev properties).
*/
response = qmp("{'... | 1,612 |
qemu | a8ff4316795c7051b38727ec4a81c65dfcf63dc6 | 0 | static void xen_io_del(MemoryListener *listener,
MemoryRegionSection *section)
{
XenIOState *state = container_of(listener, XenIOState, io_listener);
xen_unmap_io_section(xen_xc, xen_domid, state->ioservid, section);
memory_region_unref(section->mr);
}
| 1,613 |
qemu | e3f5ec2b5e92706e3b807059f79b1fb5d936e567 | 0 | static void mipsnet_receive(void *opaque, const uint8_t *buf, size_t size)
{
MIPSnetState *s = opaque;
#ifdef DEBUG_MIPSNET_RECEIVE
printf("mipsnet: receiving len=%d\n", size);
#endif
if (!mipsnet_can_receive(opaque))
return;
s->busy = 1;
/* Just accept everything. */
/... | 1,614 |
qemu | 2b147555f78c3c20080b201fd1506467fa0ddf43 | 0 | int kvm_s390_set_mem_limit(KVMState *s, uint64_t new_limit, uint64_t *hw_limit)
{
int rc;
struct kvm_device_attr attr = {
.group = KVM_S390_VM_MEM_CTRL,
.attr = KVM_S390_VM_MEM_LIMIT_SIZE,
.addr = (uint64_t) &new_limit,
};
if (!kvm_s390_supports_mem_limit(s)) {
... | 1,615 |
FFmpeg | 6c9c8b06b32013c58101f27991eae251bf4eb485 | 0 | static int ra144_decode_frame(AVCodecContext * avctx, void *vdata,
int *data_size, const uint8_t *buf, int buf_size)
{
static const uint8_t sizes[10] = {6, 5, 5, 4, 4, 3, 3, 3, 3, 2};
unsigned int refl_rms[4]; // RMS of the reflection coefficients
uint16_t block_coefs[4... | 1,617 |
qemu | 90e496386fe7fd32c189561f846b7913f95b8cf4 | 0 | static void read_vec_element(DisasContext *s, TCGv_i64 tcg_dest, int srcidx,
int element, TCGMemOp memop)
{
int vect_off = vec_reg_offset(srcidx, element, memop & MO_SIZE);
switch (memop) {
case MO_8:
tcg_gen_ld8u_i64(tcg_dest, cpu_env, vect_off);
break;
... | 1,618 |
qemu | f1839938b090b28537d9be2c1b255b834f3cfbb8 | 0 | int qemu_boot_set(const char *boot_order)
{
if (!boot_set_handler) {
return -EINVAL;
}
return boot_set_handler(boot_set_opaque, boot_order);
}
| 1,619 |
qemu | 879c28133dfa54b780dffbb29e4dcfc6581f6281 | 0 | static ssize_t local_readlink(FsContext *ctx, const char *path,
char *buf, size_t bufsz)
{
return readlink(rpath(ctx, path), buf, bufsz);
}
| 1,620 |
qemu | bd269ebc82fbaa5fe7ce5bc7c1770ac8acecd884 | 0 | void unix_start_incoming_migration(const char *path, Error **errp)
{
SocketAddressLegacy *saddr = unix_build_address(path);
socket_start_incoming_migration(saddr, errp);
}
| 1,623 |
qemu | e82d5a2460b0e176128027651ff9b104e4bdf5cc | 0 | void tcg_gen_atomic_cmpxchg_i32(TCGv_i32 retv, TCGv addr, TCGv_i32 cmpv,
TCGv_i32 newv, TCGArg idx, TCGMemOp memop)
{
memop = tcg_canonicalize_memop(memop, 0, 0);
if (!parallel_cpus) {
TCGv_i32 t1 = tcg_temp_new_i32();
TCGv_i32 t2 = tcg_temp_new_i32();
... | 1,624 |
qemu | 0f5cb2989f33059a70e8da335b62af5f27fabbe2 | 0 | static void rtce_init(VIOsPAPRDevice *dev)
{
size_t size = (dev->rtce_window_size >> SPAPR_VIO_TCE_PAGE_SHIFT)
* sizeof(VIOsPAPR_RTCE);
if (size) {
dev->rtce_table = g_malloc0(size);
}
}
| 1,625 |
qemu | 4be746345f13e99e468c60acbd3a355e8183e3ce | 0 | BlockAIOCB *ide_issue_trim(BlockDriverState *bs,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockCompletionFunc *cb, void *opaque)
{
TrimAIOCB *iocb;
iocb = qemu_aio_get(&trim_aiocb_info, bs, cb, opaque);
iocb->bh = qemu_bh_new(ide_trim_bh_cb, iocb);
iocb->ret = 0;
... | 1,627 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | uint32_t lduw_phys(target_phys_addr_t addr)
{
return lduw_phys_internal(addr, DEVICE_NATIVE_ENDIAN);
}
| 1,629 |
FFmpeg | 5a455dd011151fd7e3f8aced745b206ca1413d29 | 0 | static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int size)
{
DiracContext *s = avctx->priv_data;
DiracFrame *pic = NULL;
int ret, i, parse_code = buf[4];
unsigned tmp;
if (size < DATA_UNIT_HEADER_SIZE)
return -1;
init_get_bits(&s->gb, &buf[13],... | 1,630 |
FFmpeg | 3b77e48f0a4b6d660cd7eb14cd56f93fcb426ae2 | 0 | static int h264_parse(AVCodecParserContext *s,
AVCodecContext *avctx,
uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size)
{
H264Context *h = s->priv_data;
ParseContext *pc = &h->s.parse_context;
int next;
if(... | 1,631 |
FFmpeg | 928cb84b32b639841ac1ec2957155a6abd53309f | 0 | av_cold void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx)
{
const unsigned high_bit_depth = avctx->bits_per_raw_sample > 8;
if (avctx->lowres==1) {
c->idct_put = ff_jref_idct4_put;
c->idct_add = ff_jref_idct4_add;
c->idct = ff_j_rev_dct4;
c->perm_type... | 1,632 |
qemu | 124fe7fb1b7a1db8cb2ebb9edae84716ffaf37ce | 1 | do_command(GIOChannel *source,
GIOCondition condition,
gpointer data)
{
char *string;
VCardEmulError error;
static unsigned int default_reader_id;
unsigned int reader_id;
VReader *reader = NULL;
GError *err = NULL;
g_assert(condition & G_IO_IN);
reade... | 1,633 |
qemu | ec45bbe5f1921c6553fbf9c0c76b358b0403c22d | 1 | envlist_unsetenv(envlist_t *envlist, const char *env)
{
struct envlist_entry *entry;
size_t envname_len;
if ((envlist == NULL) || (env == NULL))
return (EINVAL);
/* env is not allowed to contain '=' */
if (strchr(env, '=') != NULL)
return (EINVAL);
/*
* Find out the requested entry and remov... | 1,634 |
FFmpeg | 44c10168cff41c200825448b77cb8feff0d316c9 | 1 | static av_cold int mpc8_decode_init(AVCodecContext * avctx)
{
int i;
MPCContext *c = avctx->priv_data;
GetBitContext gb;
static int vlc_initialized = 0;
int channels;
static VLC_TYPE band_table[542][2];
static VLC_TYPE q1_table[520][2];
static VLC_TYPE q9up_table[524][2];
... | 1,635 |
FFmpeg | 6ad45600313f0df1abf31abdd28f4339dbdc7ca0 | 1 | static int decode_pivot(MSS1Context *ctx, ArithCoder *acoder, int base)
{
int val, inv;
inv = arith_get_model_sym(acoder, &ctx->edge_mode);
val = arith_get_model_sym(acoder, &ctx->pivot) + 1;
if (val > 2) {
if ((base + 1) / 2 - 2 <= 0) {
ctx->corrupted = 1;
re... | 1,636 |
qemu | c1843e20924c9f79c8233ea34db31f3ae2a74677 | 1 | static void ccw_init(MachineState *machine)
{
int ret;
VirtualCssBus *css_bus;
s390_sclp_init();
s390_memory_init(machine->ram_size);
/* init CPUs (incl. CPU model) early so s390_has_feature() works */
s390_init_cpus(machine);
s390_flic_init();
/* get a BUS */
css_b... | 1,637 |
qemu | 7e680753cfa2986e0a8b3b222b6bf0b003c5eb69 | 1 | int kvm_uncoalesce_mmio_region(target_phys_addr_t start, ram_addr_t size)
{
int ret = -ENOSYS;
KVMState *s = kvm_state;
if (s->coalesced_mmio) {
struct kvm_coalesced_mmio_zone zone;
zone.addr = start;
zone.size = size;
ret = kvm_vm_ioctl(s, KVM_UNREGISTER_COALE... | 1,638 |
FFmpeg | 073c2593c9f0aa4445a6fc1b9b24e6e52a8cc2c1 | 1 | static int wma_decode_init(AVCodecContext * avctx)
{
WMADecodeContext *s = avctx->priv_data;
int i, flags1, flags2;
float *window;
uint8_t *extradata;
float bps1, high_freq;
volatile float bps;
int sample_rate1;
int coef_vlc_table;
s->sample_rate = avctx->sample_rate;... | 1,639 |
qemu | a697a334b3c4d3250e6420f5d38550ea10eb5319 | 1 | void virtio_net_exit(VirtIODevice *vdev)
{
VirtIONet *n = DO_UPCAST(VirtIONet, vdev, vdev);
qemu_del_vm_change_state_handler(n->vmstate);
if (n->vhost_started) {
vhost_net_stop(tap_get_vhost_net(n->nic->nc.peer), vdev);
}
qemu_purge_queued_packets(&n->nic->nc);
unregister_s... | 1,640 |
qemu | d3392718e1fcf0859fb7c0774a8e946bacb8419c | 1 | static void v7m_exception_taken(ARMCPU *cpu, uint32_t lr)
{
/* Do the "take the exception" parts of exception entry,
* but not the pushing of state to the stack. This is
* similar to the pseudocode ExceptionTaken() function.
*/
CPUARMState *env = &cpu->env;
uint32_t addr;
armv7m... | 1,641 |
qemu | 84a3a53cf61ef691478bd91afa455c801696053c | 1 | static int omap_intc_init(SysBusDevice *sbd)
{
DeviceState *dev = DEVICE(sbd);
struct omap_intr_handler_s *s = OMAP_INTC(dev);
if (!s->iclk) {
hw_error("omap-intc: clk not connected\n");
}
s->nbanks = 1;
sysbus_init_irq(sbd, &s->parent_intr[0]);
sysbus_init_irq(sbd, &s->pa... | 1,643 |
FFmpeg | 8fb22c3d47ccb87d0ee235226a700d2b3ca97afb | 1 | static void mov_read_chapters(AVFormatContext *s)
{
MOVContext *mov = s->priv_data;
AVStream *st = NULL;
MOVStreamContext *sc;
int64_t cur_pos;
int i;
for (i = 0; i < s->nb_streams; i++)
if (s->streams[i]->id == mov->chapter_track) {
st = s->streams[i];
... | 1,644 |
FFmpeg | ebcf7c3227906382205141beb2d0467f245472d1 | 1 | int ff_cmap_read_palette(AVCodecContext *avctx, uint32_t *pal)
{
int count, i;
if (avctx->bits_per_coded_sample > 8) {
av_log(avctx, AV_LOG_ERROR, "bit_per_coded_sample > 8 not supported\n");
return AVERROR_INVALIDDATA;
}
count = 1 << avctx->bits_per_coded_sample;
if (avc... | 1,645 |
qemu | e4f4fb1eca795e36f363b4647724221e774523c1 | 1 | static void isabus_bridge_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
dc->fw_name = "isa";
} | 1,646 |
qemu | 7faa8075d898ae56d2c533c530569bb25ab86eaf | 1 | static void disable_device(PIIX4PMState *s, int slot)
{
s->ar.gpe.sts[0] |= PIIX4_PCI_HOTPLUG_STATUS;
s->pci0_status.down |= (1 << slot);
}
| 1,647 |
qemu | de258eb07db6cf893ef1bfad8c0cedc0b983db55 | 1 | void page_set_flags(target_ulong start, target_ulong end, int flags)
{
target_ulong addr, len;
/* This function should never be called with addresses outside the
guest address space. If this assert fires, it probably indicates
a missing call to h2g_valid. */
#if TARGET_ABI_BITS > L1_MAP_... | 1,648 |
qemu | ebee92b4fef9defa19a8c348ec8b2716732ad4df | 1 | static int print_block_option_help(const char *filename, const char *fmt)
{
BlockDriver *drv, *proto_drv;
QEMUOptionParameter *create_options = NULL;
/* Find driver and parse its options */
drv = bdrv_find_format(fmt);
if (!drv) {
error_report("Unknown file format '%s'", fmt);
... | 1,649 |
FFmpeg | 5a8311513091ea7277578fbaf189e460dd1d4c7d | 1 | av_cold int ffv1_init_slice_contexts(FFV1Context *f)
{
int i;
f->slice_count = f->num_h_slices * f->num_v_slices;
av_assert0(f->slice_count > 0);
for (i = 0; i < f->slice_count; i++) {
FFV1Context *fs = av_mallocz(sizeof(*fs));
int sx = i % f->num_h_slices;
int sy ... | 1,650 |
FFmpeg | e004d175fe2463af8242e390b15350f4745be7b4 | 1 | void ff_rtp_send_aac(AVFormatContext *s1, const uint8_t *buff, int size)
{
RTPMuxContext *s = s1->priv_data;
int len, max_packet_size;
uint8_t *p;
const int max_frames_per_packet = s->max_frames_per_packet ? s->max_frames_per_packet : 5;
const int max_au_headers_size = 2 + 2 * max_frames_per_p... | 1,651 |
FFmpeg | 06bb1de1c78a3653e197ff3434d550499b556e72 | 1 | static int vqf_read_packet(AVFormatContext *s, AVPacket *pkt)
{
VqfContext *c = s->priv_data;
int ret;
int size = (c->frame_bit_len - c->remaining_bits + 7)>>3;
if (av_new_packet(pkt, size+2) < 0)
return AVERROR(EIO);
pkt->pos = avio_tell(s->pb);
pkt->stream_index = ... | 1,652 |
qemu | b9ec9bd468b2c5b218d16642e8f8ea4df60418bb | 1 | static int vhost_user_cleanup(struct vhost_dev *dev)
{
struct vhost_user *u;
assert(dev->vhost_ops->backend_type == VHOST_BACKEND_TYPE_USER);
u = dev->opaque;
if (u->slave_fd >= 0) {
close(u->slave_fd);
u->slave_fd = -1;
}
g_free(u);
dev->opaque = 0;
ret... | 1,653 |
FFmpeg | e2710e790c09e49e86baa58c6063af0097cc8cb0 | 1 | av_cold void ff_fmt_convert_init_arm(FmtConvertContext *c, AVCodecContext *avctx)
{
int cpu_flags = av_get_cpu_flags();
if (have_vfp(cpu_flags)) {
if (!have_vfpv3(cpu_flags)) {
c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_vfp;
c->int32_to_float_fmul_array... | 1,654 |
FFmpeg | d1adad3cca407f493c3637e20ecd4f7124e69212 | 0 | static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth, const uint8_t *src, int srcW, int xInc,
const int16_t *hLumFilter,
const int16_t *hLumFilterPos, int hLumFilterSize,
uint8_t *format... | 1,655 |
FFmpeg | c619ff6daf93a8f3c03decf2d3345d2474c3db91 | 0 | static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, DCTELEM *block)
{
int last_index = get_bits_size(gb);
const uint8_t *scan_table = mb->scan_table;
const uint8_t *shift_table = mb->shift_table;
int pos = mb->pos;
int partial_bit_count = mb->partial_bit_count;
int level, pos1, run... | 1,656 |
FFmpeg | 5c3383e5b5c7e3e3c1ba86a58d3e0a1ebf521aa7 | 0 | int opt_default(const char *opt, const char *arg){
int type;
const AVOption *o= NULL;
int opt_types[]={AV_OPT_FLAG_VIDEO_PARAM, AV_OPT_FLAG_AUDIO_PARAM, 0, AV_OPT_FLAG_SUBTITLE_PARAM, 0};
for(type=0; type<CODEC_TYPE_NB; type++){
const AVOption *o2 = av_find_opt(avctx_opts[0], opt, NULL, o... | 1,658 |
FFmpeg | a71e9b62546e4467751c0219869a7f6d004a5986 | 0 | static float quantize_band_cost(struct AACEncContext *s, const float *in,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
int *bits)
{
const float IQ = ff_aac_pow2sf_tab[... | 1,659 |
FFmpeg | b44985ba12d927d643a7bc03b0db98b83bf4fc9e | 0 | static int encode_subband_c0run(SnowContext *s, SubBand *b, DWTELEM *src, DWTELEM *parent, int stride, int orientation){
const int w= b->width;
const int h= b->height;
int x, y;
if(1){
int run=0;
int runs[w*h];
int run_index=0;
for(y=0; y<h; y+... | 1,660 |
FFmpeg | a3a8572165ce636fb011b78764a2584777f81b95 | 0 | static int g722_decode_frame(AVCodecContext *avctx, void *data,
int *data_size, AVPacket *avpkt)
{
G722Context *c = avctx->priv_data;
int16_t *out_buf = data;
int j, out_len = 0;
const int skip = 8 - avctx->bits_per_coded_sample;
const int16_t *quantizer_table = l... | 1,661 |
qemu | 93dd748b789202af4f5be75412c58ee1ed481b29 | 1 | int qemu_create_pidfile(const char *filename)
{
char buffer[128];
int len;
int fd;
fd = qemu_open(filename, O_RDWR | O_CREAT, 0600);
if (fd == -1) {
return -1;
}
if (lockf(fd, F_TLOCK, 0) == -1) {
close(fd);
return -1;
}
len = snprintf(buffer, s... | 1,662 |
FFmpeg | 6ed3565f08abf3b1c2a1d2d7fac768b18753530c | 1 | static av_cold int v410_decode_init(AVCodecContext *avctx)
{
avctx->pix_fmt = PIX_FMT_YUV444P10;
avctx->bits_per_raw_sample = 10;
if (avctx->width & 1) {
av_log(avctx, AV_LOG_ERROR, "v410 requires width to be even.\n");
return AVERROR_INVALIDDATA;
}
avctx->cod... | 1,663 |
FFmpeg | 9c9ede44f37e291677c0db1c5fabf1c3f6106008 | 1 | static int alloc_picture(H264Context *h, Picture *pic)
{
int i, ret = 0;
av_assert0(!pic->f.data[0]);
if (h->avctx->hwaccel) {
const AVHWAccel *hwaccel = h->avctx->hwaccel;
av_assert0(!pic->hwaccel_picture_private);
if (hwaccel->priv_data_size) {
pic->hwaccel_... | 1,664 |
qemu | c627e7526a902dd5bb1907dbbd5cf961679dfa68 | 1 | static void rc4030_dma_tt_update(rc4030State *s, uint32_t new_tl_base,
uint32_t new_tl_limit)
{
int entries, i;
dma_pagetable_entry *dma_tl_contents;
if (s->dma_tl_limit) {
/* write old dma tl table to physical memory */
memory_region_del_subregion(g... | 1,665 |
FFmpeg | 5c720657c23afd798ae0db7c7362eb859a89ab3d | 1 | static int mov_read_dvc1(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
uint8_t profile_level;
if (c->fc->nb_streams < 1)
return 0;
st = c->fc->streams[c->fc->nb_streams-1];
if (atom.size >= (1<<28) || atom.size < 7)
return AVERROR_INVALIDDATA;
profi... | 1,666 |
FFmpeg | f0f2babca23a3d099bcd5a1e18cf5d0eae2f4ef3 | 0 | static void zero_remaining(unsigned int b, unsigned int b_max,
const unsigned int *div_blocks, int32_t *buf)
{
unsigned int count = 0;
while (b < b_max)
count += div_blocks[b];
if (count)
memset(buf, 0, sizeof(*buf) * count);
}
| 1,667 |
FFmpeg | 645f7c1ce547f247af56990e6306d08d3d6a6286 | 1 | static int push_samples(AVFilterContext *ctx, int nb_samples)
{
AVFilterLink *outlink = ctx->outputs[0];
LoopContext *s = ctx->priv;
AVFrame *out;
int ret, i = 0;
while (s->loop != 0 && i < nb_samples) {
out = ff_get_audio_buffer(outlink, FFMIN(nb_samples, s->nb_samples - s->current... | 1,668 |
qemu | cd245a19329edfcd968b00d05ad92de7a0e2daa1 | 1 | void *qemu_realloc(void *ptr, size_t size)
{
if (!size && !allow_zero_malloc()) {
abort();
}
return oom_check(realloc(ptr, size ? size : 1));
}
| 1,669 |
qemu | 5706db1deb061ee9affdcea81e59c4c2cad7c41e | 1 | static int coreaudio_init_out (HWVoiceOut *hw, struct audsettings *as)
{
OSStatus status;
coreaudioVoiceOut *core = (coreaudioVoiceOut *) hw;
UInt32 propertySize;
int err;
const char *typ = "playback";
AudioValueRange frameRange;
/* create mutex */
err = pthread_mutex_init(&co... | 1,670 |
qemu | 2e1cf2c9685978193ef429cdb711bf50debea9d8 | 1 | static void xilinx_spips_flush_txfifo(XilinxSPIPS *s)
{
int debug_level = 0;
XilinxQSPIPS *q = (XilinxQSPIPS *) object_dynamic_cast(OBJECT(s),
TYPE_XILINX_QSPIPS);
for (;;) {
int i;
uint8_t tx = 0;
uint8_t tx_rx[num... | 1,671 |
FFmpeg | c04c3282b4334ff64cfd69d40fea010602e830fd | 0 | static int img_set_parameters(AVFormatContext *s, AVFormatParameters *ap)
{
VideoData *img = s->priv_data;
AVStream *st;
AVImageFormat *img_fmt;
int i;
/* find output image format */
if (ap && ap->image_format) {
img_fmt = ap->image_format;
} else {
img_fmt = gues... | 1,674 |
qemu | 480cff632221dc4d4889bf72dd0f09cd35096bc1 | 1 | void qemu_coroutine_enter(Coroutine *co)
{
Coroutine *self = qemu_coroutine_self();
CoroutineAction ret;
trace_qemu_coroutine_enter(self, co, co->entry_arg);
if (co->caller) {
fprintf(stderr, "Co-routine re-entered recursively\n");
abort();
}
co->caller = self;
... | 1,676 |
qemu | 7633378d5fbe932c9d38ae8961ef035d1ed26bfd | 1 | static void aarch64_cpu_set_pc(CPUState *cs, vaddr value)
{
ARMCPU *cpu = ARM_CPU(cs);
/*
* TODO: this will need updating for system emulation,
* when the core may be in AArch32 mode.
*/
cpu->env.pc = value;
}
| 1,678 |
qemu | 302a0d3ed721e4c30c6a2a37f64c60b50ffd33b9 | 1 | static struct iovec *cap_sg(struct iovec *sg, int cap, int *cnt)
{
int i;
int total = 0;
for (i = 0; i < *cnt; i++) {
if ((total + sg[i].iov_len) > cap) {
sg[i].iov_len -= ((total + sg[i].iov_len) - cap);
i++;
break;
}
total += sg[i].io... | 1,679 |
qemu | ae50b2747f77944faa79eb914272b54eb30b63b3 | 1 | void mcf_fec_init(NICInfo *nd, target_phys_addr_t base, qemu_irq *irq)
{
mcf_fec_state *s;
qemu_check_nic_model(nd, "mcf_fec");
s = (mcf_fec_state *)qemu_mallocz(sizeof(mcf_fec_state));
s->irq = irq;
s->mmio_index = cpu_register_io_memory(mcf_fec_readfn,
... | 1,680 |
FFmpeg | a62242678ff96eade59960d1bbf65e4f3f03344f | 1 | static int opt_sameq(void *optctx, const char *opt, const char *arg)
{
av_log(NULL, AV_LOG_WARNING, "Ignoring option '%s'\n", opt);
return 0;
}
| 1,681 |
FFmpeg | 221b804f3491638ecf2eec1302c669ad2d9ec799 | 1 | static inline void yuv2nv12XinC(int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
uint8_t *dest, uint8_t *uDest, int dstW, int chrDstW, int dstFormat)
{
//FIXME Optimize (just quickly writen not opti..)
int i;
for(i=0; i<dstW; i++)
{
... | 1,682 |
FFmpeg | a7f6bfdc185a04a703bedd712ee306435372af12 | 0 | static void lowpass_line_complex_c(uint8_t *dstp, ptrdiff_t width, const uint8_t *srcp,
ptrdiff_t mref, ptrdiff_t pref)
{
const uint8_t *srcp_above = srcp + mref;
const uint8_t *srcp_below = srcp + pref;
const uint8_t *srcp_above2 = srcp + mref * 2;
const uint8_t... | 1,684 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void pic_write(void *opaque, target_phys_addr_t addr,
uint64_t value, unsigned size)
{
HeathrowPICS *s = opaque;
HeathrowPIC *pic;
unsigned int n;
n = ((addr & 0xfff) - 0x10) >> 4;
PIC_DPRINTF("writel: " TARGET_FMT_plx " %u: %08x\n", addr, n, value);
if (n ... | 1,685 |
qemu | bec1631100323fac0900aea71043d5c4e22fc2fa | 0 | static void tcg_out_jxx(TCGContext *s, int opc, int label_index, int small)
{
int32_t val, val1;
TCGLabel *l = &s->labels[label_index];
if (l->has_value) {
val = tcg_pcrel_diff(s, l->u.value_ptr);
val1 = val - 2;
if ((int8_t)val1 == val1) {
if (opc == -1) {
... | 1,686 |
qemu | 91cda45b69e45a089f9989979a65db3f710c9925 | 0 | hwaddr ppc_hash32_get_phys_page_debug(CPUPPCState *env, target_ulong addr)
{
struct mmu_ctx_hash32 ctx;
if (unlikely(ppc_hash32_get_physical_address(env, &ctx, addr, 0, ACCESS_INT)
!= 0)) {
return -1;
}
return ctx.raddr & TARGET_PAGE_MASK;
}
| 1,687 |
qemu | f50159fa9b5a0ad82e30c123643ec39a1df81d9a | 0 | static int vhdx_log_write(BlockDriverState *bs, BDRVVHDXState *s,
void *data, uint32_t length, uint64_t offset)
{
int ret = 0;
void *buffer = NULL;
void *merged_sector = NULL;
void *data_tmp, *sector_write;
unsigned int i;
int sector_offset;
uint32_t desc_s... | 1,689 |
qemu | 439e2a6e10ed7f5da819bf7dcaa54b8cfdbeab0d | 0 | Aml *aml_index(Aml *arg1, Aml *idx)
{
Aml *var = aml_opcode(0x88 /* IndexOp */);
aml_append(var, arg1);
aml_append(var, idx);
build_append_byte(var->buf, 0x00 /* NullNameOp */);
return var;
}
| 1,690 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void timer_write(void *opaque, target_phys_addr_t addr,
uint64_t value, unsigned size)
{
LM32TimerState *s = opaque;
trace_lm32_timer_memory_write(addr, value);
addr >>= 2;
switch (addr) {
case R_SR:
s->regs[R_SR] &= ~SR_TO;
break;
cas... | 1,691 |
qemu | 7bd427d801e1e3293a634d3c83beadaa90ffb911 | 0 | static inline void menelaus_rtc_start(MenelausState *s)
{
s->rtc.next += qemu_get_clock(rt_clock);
qemu_mod_timer(s->rtc.hz_tm, s->rtc.next);
}
| 1,692 |
qemu | c363acef772647f66becdbf46dd54e70e67f3cc9 | 0 | static void test_visitor_in_alternate_number(TestInputVisitorData *data,
const void *unused)
{
Visitor *v;
Error *err = NULL;
AltStrBool *asb;
AltStrNum *asn;
AltNumStr *ans;
AltStrInt *asi;
AltIntNum *ain;
AltNumInt *ani;
/* ... | 1,693 |
qemu | abd696e4f74a9d30801c6ae2693efe4e5979c2f2 | 0 | static int zipl_run(struct scsi_blockptr *pte)
{
struct component_header *header;
struct component_entry *entry;
uint8_t tmp_sec[SECTOR_SIZE];
virtio_read(pte->blockno, tmp_sec);
header = (struct component_header *)tmp_sec;
if (!zipl_magic(tmp_sec)) {
goto fail;
}
... | 1,694 |
FFmpeg | ebba2b3e2a551ce638d17332761431ba748f178f | 0 | static int udp_write(URLContext *h, const uint8_t *buf, int size)
{
UDPContext *s = h->priv_data;
int ret;
for(;;) {
if (!s->is_connected) {
ret = sendto (s->udp_fd, buf, size, 0,
(struct sockaddr *) &s->dest_addr,
s->dest_add... | 1,695 |
qemu | 4be746345f13e99e468c60acbd3a355e8183e3ce | 0 | static int megasas_cache_flush(MegasasState *s, MegasasCmd *cmd)
{
bdrv_drain_all();
return MFI_STAT_OK;
}
| 1,696 |
qemu | a4a1c70dc759e5b81627e96564f344ab43ea86eb | 0 | static void test_visitor_in_fail_list_nested(TestInputVisitorData *data,
const void *unused)
{
int64_t i64 = -1;
Visitor *v;
/* Unvisited nested list tail */
v = visitor_input_test_init(data, "[ 0, [ 1, 2, 3 ] ]");
visit_start_list(v, NULL, N... | 1,697 |
qemu | 2e2aa31674444b61e79536a90d63a90572e695c8 | 0 | static void mptsas_scsi_uninit(PCIDevice *dev)
{
MPTSASState *s = MPT_SAS(dev);
qemu_bh_delete(s->request_bh);
if (s->msi_in_use) {
msi_uninit(dev);
}
}
| 1,698 |
qemu | a7812ae412311d7d47f8aa85656faadac9d64b56 | 0 | static unsigned int dec_swap_r(DisasContext *dc)
{
TCGv t0;
#if DISAS_CRIS
char modename[4];
#endif
DIS(fprintf (logfile, "swap%s $r%u\n",
swapmode_name(dc->op2, modename), dc->op1));
cris_cc_mask(dc, CC_MASK_NZ);
t0 = tcg_temp_new(TCG_TYPE_TL);
t_gen_mov_TN_reg(t0, dc->op1);
if (dc->op2 & 8)... | 1,699 |
qemu | b3db211f3c80bb996a704d665fe275619f728bd4 | 0 | static void test_visitor_in_number(TestInputVisitorData *data,
const void *unused)
{
double res = 0, value = 3.14;
Visitor *v;
v = visitor_input_test_init(data, "%f", value);
visit_type_number(v, NULL, &res, &error_abort);
g_assert_cmpfloat(res, ==, valu... | 1,700 |
qemu | 1263b7d6131cdaed2c460cf03757aaaf5696ec47 | 0 | static int protocol_client_auth(VncState *vs, uint8_t *data, size_t len)
{
/* We only advertise 1 auth scheme at a time, so client
* must pick the one we sent. Verify this */
if (data[0] != vs->vd->auth) { /* Reject auth */
VNC_DEBUG("Reject auth %d\n", (int)data[0]);
vnc_write_u32(vs, ... | 1,702 |
qemu | 61007b316cd71ee7333ff7a0a749a8949527575f | 0 | BlockAIOCB *bdrv_aio_readv(BlockDriverState *bs, int64_t sector_num,
QEMUIOVector *qiov, int nb_sectors,
BlockCompletionFunc *cb, void *opaque)
{
trace_bdrv_aio_readv(bs, sector_num, nb_sectors, opaque);
return bdrv_co_aio_rw_vector(bs, sector_num, qi... | 1,703 |
qemu | 6a50636f35ba677c747f2f6127b0dba994b039ca | 0 | static int do_qmp_capabilities(Monitor *mon, const QDict *params,
QObject **ret_data)
{
/* Will setup QMP capabilities in the future */
if (monitor_ctrl_mode(mon)) {
mon->qmp.command_mode = 1;
}
return 0;
}
| 1,704 |
qemu | c6572fa0d2b81bc3a9ca5716f975f2bf59c62e6c | 0 | int vhdx_log_write_and_flush(BlockDriverState *bs, BDRVVHDXState *s,
void *data, uint32_t length, uint64_t offset)
{
int ret = 0;
VHDXLogSequence logs = { .valid = true,
.count = 1,
.hdr = { 0 } };
/* Make sure... | 1,705 |
qemu | f1c52354e5bdab6983d13a4c174759c585e834b3 | 0 | static bool release_pending(sPAPRDRConnector *drc)
{
return drc->awaiting_release;
}
| 1,707 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | void dp83932_init(NICInfo *nd, target_phys_addr_t base, int it_shift,
MemoryRegion *address_space,
qemu_irq irq, void* mem_opaque,
void (*memory_rw)(void *opaque, target_phys_addr_t addr, uint8_t *buf, int len, int is_write))
{
dp8393xState *s;
qemu_... | 1,708 |
qemu | 32bafa8fdd098d52fbf1102d5a5e48d29398c0aa | 0 | int net_init_l2tpv3(const NetClientOptions *opts,
const char *name,
NetClientState *peer, Error **errp)
{
/* FIXME error_setg(errp, ...) on failure */
const NetdevL2TPv3Options *l2tpv3;
NetL2TPV3State *s;
NetClientState *nc;
int fd = -1, gairet;
s... | 1,709 |
qemu | 83f338f73ecb88cc6f85d6e7b81ebef112ce07be | 0 | CPUDebugExcpHandler *cpu_set_debug_excp_handler(CPUDebugExcpHandler *handler)
{
CPUDebugExcpHandler *old_handler = debug_excp_handler;
debug_excp_handler = handler;
return old_handler;
}
| 1,711 |
FFmpeg | 03dab49a1267630375c4fc15dec1136814b1f117 | 0 | av_cold int ff_vp56_init_context(AVCodecContext *avctx, VP56Context *s,
int flip, int has_alpha)
{
int i;
s->avctx = avctx;
avctx->pix_fmt = has_alpha ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P;
if (avctx->skip_alpha) avctx->pix_fmt = AV_PIX_FMT_YUV420P;
... | 1,714 |
FFmpeg | 246d3bf0ec93dd21069f9352ed4909aec334cd4d | 0 | static av_always_inline void dist_scale(HEVCContext *s, Mv *mv,
int min_pu_width, int x, int y,
int elist, int ref_idx_curr, int ref_idx)
{
RefPicList *refPicList = s->ref->refPicList;
MvField *tab_mvf = s->ref->tab_mvf;
... | 1,715 |
FFmpeg | 3c895fc098f7637f6d5ec3a9d6766e724a8b9e41 | 0 | static int rm_write_video(AVFormatContext *s, const uint8_t *buf, int size)
{
RMContext *rm = s->priv_data;
ByteIOContext *pb = &s->pb;
StreamInfo *stream = rm->video_stream;
int key_frame = stream->enc->coded_frame->key_frame;
/* XXX: this is incorrect: should be a parameter */
/* We... | 1,716 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.