project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | 082c6681b6c4af0035d9dad34a4a784be8c21dbe | 0 | static void gen_spr_620 (CPUPPCState *env)
{
/* XXX : not implemented */
spr_register(env, SPR_620_PMR0, "PMR0",
SPR_NOACCESS, SPR_NOACCESS,
&spr_read_generic, &spr_write_generic,
0x00000000);
/* XXX : not implemented */
spr_register(env, SPR_62... | 20,252 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static struct dpll_ctl_s *omap_dpll_init(MemoryRegion *memory,
target_phys_addr_t base, omap_clk clk)
{
struct dpll_ctl_s *s = g_malloc0(sizeof(*s));
memory_region_init_io(&s->iomem, &omap_dpll_ops, s, "omap-dpll", 0x100);
s->dpll = clk;
omap_dpll_reset(s);
mem... | 20,253 |
qemu | b25b387fa5928e516cb2c9e7fde68e958bd7e50a | 0 | static void qcow2_close(BlockDriverState *bs)
{
BDRVQcow2State *s = bs->opaque;
qemu_vfree(s->l1_table);
/* else pre-write overlap checks in cache_destroy may crash */
s->l1_table = NULL;
if (!(s->flags & BDRV_O_INACTIVE)) {
qcow2_inactivate(bs);
}
cache_clean_timer_del(... | 20,254 |
FFmpeg | dd0724288ee86d487e261f23471f861ff4620d8e | 0 | static int opt_output_file(const char *opt, const char *filename)
{
AVFormatContext *oc;
int i, err;
AVOutputFormat *file_oformat;
OutputStream *ost;
InputStream *ist;
if (!strcmp(filename, "-"))
filename = "pipe:";
err = avformat_alloc_output_context2(&oc, NULL, last_a... | 20,255 |
qemu | 496272a7018ba01aa2b87a1a5ed866ff85133401 | 0 | static int pte64_check(mmu_ctx_t *ctx, target_ulong pte0,
target_ulong pte1, int h, int rw, int type)
{
target_ulong ptem, mmask;
int access, ret, pteh, ptev, pp;
ret = -1;
/* Check validity and table match */
ptev = pte64_is_valid(pte0);
pteh = (pte0 >> 1) & 1;
... | 20,256 |
qemu | fd56e0612b6454a282fa6a953fdb09281a98c589 | 0 | static void usb_xhci_realize(struct PCIDevice *dev, Error **errp)
{
int i, ret;
Error *err = NULL;
XHCIState *xhci = XHCI(dev);
dev->config[PCI_CLASS_PROG] = 0x30; /* xHCI */
dev->config[PCI_INTERRUPT_PIN] = 0x01; /* interrupt pin 1 */
dev->config[PCI_CACHE_LINE_SIZE] = 0x10;
... | 20,258 |
qemu | 99d09dd32820f5702031e3c08c81f8c209dc2220 | 0 | void acpi_pcihp_init(AcpiPciHpState *s, PCIBus *root_bus,
MemoryRegion *address_space_io)
{
s->root= root_bus;
memory_region_init_io(&s->io, NULL, &acpi_pcihp_io_ops, s,
"acpi-pci-hotplug",
PCI_HOTPLUG_SIZE);
memory_region_add_s... | 20,259 |
qemu | 7d5e199ade76c53ec316ab6779800581bb47c50a | 0 | static void qmp_output_complete(Visitor *v, void *opaque)
{
QmpOutputVisitor *qov = to_qov(v);
/* A visit must have occurred, with each start paired with end. */
assert(qov->root && QSLIST_EMPTY(&qov->stack));
assert(opaque == qov->result);
qobject_incref(qov->root);
*qov->result = q... | 20,260 |
qemu | dfd100f242370886bb6732f70f1f7cbd8eb9fedc | 0 | static SocketAddress *sd_server_config(QDict *options, Error **errp)
{
QDict *server = NULL;
QObject *crumpled_server = NULL;
Visitor *iv = NULL;
SocketAddressFlat *saddr_flat = NULL;
SocketAddress *saddr = NULL;
Error *local_err = NULL;
qdict_extract_subqdict(options, &server, "se... | 20,261 |
qemu | 52cfcb464255b4da5115408e2a6ce3327bbcb9df | 0 | filter_mirror_set_outdev(Object *obj, const char *value, Error **errp)
{
MirrorState *s = FILTER_MIRROR(obj);
g_free(s->outdev);
s->outdev = g_strdup(value);
if (!s->outdev) {
error_setg(errp, "filter filter mirror needs 'outdev' "
"property set");
return;
... | 20,262 |
qemu | a1aff5bf6786e6e8478373e4ada869a4ef2a7fc4 | 1 | int bdrv_is_inserted(BlockDriverState *bs)
{
BlockDriver *drv = bs->drv;
int ret;
if (!drv)
return 0;
if (!drv->bdrv_is_inserted)
return !bs->tray_open;
ret = drv->bdrv_is_inserted(bs);
return ret;
}
| 20,263 |
qemu | c7085da7266120a8594f8fddcbf3b6839a8eda58 | 1 | static void virtio_blk_update_config(VirtIODevice *vdev, uint8_t *config)
{
VirtIOBlock *s = to_virtio_blk(vdev);
struct virtio_blk_config blkcfg;
uint64_t capacity;
int cylinders, heads, secs;
bdrv_get_geometry(s->bs, &capacity);
bdrv_get_geometry_hint(s->bs, &cylinders, &heads, &secs)... | 20,264 |
qemu | dede4188cc817a039154ed2ecd7f3285f6b94056 | 1 | static int vpc_create(const char *filename, QEMUOptionParameter *options)
{
uint8_t buf[1024];
struct vhd_footer* footer = (struct vhd_footer*) buf;
struct vhd_dyndisk_header* dyndisk_header =
(struct vhd_dyndisk_header*) buf;
int fd, i;
uint16_t cyls;
uint8_t heads;
uint8_t... | 20,265 |
FFmpeg | 3e033da84782e12ed529e6a88dd53b6a72199e8e | 1 | ff_rm_retrieve_cache (AVFormatContext *s, AVIOContext *pb,
AVStream *st, RMStream *ast, AVPacket *pkt)
{
RMDemuxContext *rm = s->priv_data;
assert (rm->audio_pkt_cnt > 0);
if (st->codec->codec_id == CODEC_ID_AAC)
av_get_packet(pb, pkt, ast->sub_packet_lengths[ast->sub... | 20,266 |
qemu | e489030df2448d22b3cb92fd5dcb22c6fa0fc9e1 | 1 | static void virtio_pci_reset(void *opaque)
{
VirtIOPCIProxy *proxy = opaque;
virtio_reset(proxy->vdev);
msix_reset(&proxy->pci_dev);
}
| 20,267 |
qemu | baf35cb90204d75404892aa4e52628ae7a00669b | 1 | static int bdrv_write_em(BlockDriverState *bs, int64_t sector_num,
const uint8_t *buf, int nb_sectors)
{
int async_ret;
BlockDriverAIOCB *acb;
async_ret = NOT_DONE;
qemu_aio_wait_start();
acb = bdrv_aio_write(bs, sector_num, buf, nb_sectors,
... | 20,268 |
qemu | e4f4fb1eca795e36f363b4647724221e774523c1 | 1 | static void ioapic_class_init(ObjectClass *klass, void *data)
{
IOAPICCommonClass *k = IOAPIC_COMMON_CLASS(klass);
DeviceClass *dc = DEVICE_CLASS(klass);
k->realize = ioapic_realize;
* If APIC is in kernel, we need to update the kernel cache after
* migration, otherwise first 24 gsi route... | 20,269 |
qemu | d9968827032039d99b38db7ad3598767e1a53bbb | 1 | static inline void iwmmxt_store_creg(int reg, TCGv var)
{
tcg_gen_st_i32(var, cpu_env, offsetof(CPUState, iwmmxt.cregs[reg]));
} | 20,270 |
FFmpeg | 55f22dd473fa954a17cef2fcf089ad7fd696d4e0 | 0 | static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
const uint8_t *buf, int buf_size)
{
H264Context *h = avctx->priv_data;
MpegEncContext *s = &h->s;
AVFrame *pict = data;
int buf_index;
s->flags= avctx->flags... | 20,271 |
FFmpeg | e43a0a232dbf6d3c161823c2e07c52e76227a1bc | 0 | static AVFrame *get_video_buffer(AVFilterLink *inlink, int w, int h)
{
PadContext *s = inlink->dst->priv;
AVFrame *frame = ff_get_video_buffer(inlink->dst->outputs[0],
w + (s->w - s->in_w),
h + (s->h - s->in_h));
int p... | 20,272 |
FFmpeg | c2b0ce70add2a7dd6e792341c21278cb94820684 | 0 | int64_t ff_start_tag(AVIOContext *pb, const char *tag)
{
ffio_wfourcc(pb, tag);
avio_wl32(pb, 0);
return avio_tell(pb);
}
| 20,273 |
FFmpeg | fc7f7f171f7c5cf77cd3e56a69c5709be062fe62 | 0 | static int svq3_decode_mb(H264Context *h, unsigned int mb_type)
{
int i, j, k, m, dir, mode;
int cbp = 0;
uint32_t vlc;
int8_t *top, *left;
MpegEncContext *const s = (MpegEncContext *) h;
const int mb_xy = h->mb_xy;
const int b_xy = 4*s->mb_x + 4*s->mb_y*h->b_stride;
h->top_s... | 20,274 |
FFmpeg | f929ab0569ff31ed5a59b0b0adb7ce09df3fca39 | 0 | AVCodecContext *avcodec_alloc_context3(const AVCodec *codec)
{
AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext));
if(avctx==NULL) return NULL;
if(avcodec_get_context_defaults3(avctx, codec) < 0){
av_free(avctx);
return NULL;
}
return avctx;
}
| 20,275 |
qemu | ef1e1e0782e99c9dcf2b35e5310cdd8ca9211374 | 0 | static void exynos4210_fimd_reset(DeviceState *d)
{
Exynos4210fimdState *s = EXYNOS4210_FIMD(d);
unsigned w;
DPRINT_TRACE("Display controller reset\n");
/* Set all display controller registers to 0 */
memset(&s->vidcon, 0, (uint8_t *)&s->window - (uint8_t *)&s->vidcon);
for (w = 0; w < ... | 20,276 |
qemu | a63f1dfc6213c765b62e93b720229d522cd156f4 | 0 | void helper_slbie(CPUPPCState *env, target_ulong addr)
{
PowerPCCPU *cpu = ppc_env_get_cpu(env);
ppc_slb_t *slb;
slb = slb_lookup(cpu, addr);
if (!slb) {
return;
}
if (slb->esid & SLB_ESID_V) {
slb->esid &= ~SLB_ESID_V;
/* XXX: given the fact that segment ... | 20,277 |
qemu | 7d78066926b68afe28a1948c64618ee085d9ab02 | 0 | static int execute_command(BlockDriverState *bdrv,
SCSIRequest *r, int direction,
BlockDriverCompletionFunc *complete)
{
r->io_header.interface_id = 'S';
r->io_header.dxfer_direction = direction;
r->io_header.dxferp = r->buf;
r->io_header.dxfer_len = r->buflen;
... | 20,278 |
qemu | b77e7c8e99f9ac726c4eaa2fc3461fd886017dc0 | 0 | static void inet_addr_to_opts(QemuOpts *opts, const InetSocketAddress *addr)
{
bool ipv4 = addr->ipv4 || !addr->has_ipv4;
bool ipv6 = addr->ipv6 || !addr->has_ipv6;
if (!ipv4 || !ipv6) {
qemu_opt_set_bool(opts, "ipv4", ipv4, &error_abort);
qemu_opt_set_bool(opts, "ipv6", ipv6, &error... | 20,279 |
qemu | 1237ad7607aae5859067831e36a59d3b017c5a54 | 0 | static int local_lstat(FsContext *ctx, const char *path, struct stat *stbuf)
{
return lstat(rpath(ctx, path), stbuf);
}
| 20,280 |
qemu | 153859be1a0928d07ec2dc2b18847e32e180ff43 | 0 | static void help(void)
{
printf("qemu-img version " QEMU_VERSION ", Copyright (c) 2004-2008 Fabrice Bellard\n"
"usage: qemu-img command [command options]\n"
"QEMU disk image utility\n"
"\n"
"Command syntax:\n"
" check [-f fmt] filename\n"
" ... | 20,281 |
qemu | c60bf3391bf4cb79b7adc6650094e21671ddaabd | 0 | ReadLineState *readline_init(Monitor *mon,
ReadLineCompletionFunc *completion_finder)
{
ReadLineState *rs = g_malloc0(sizeof(*rs));
rs->hist_entry = -1;
rs->mon = mon;
rs->completion_finder = completion_finder;
return rs;
}
| 20,284 |
qemu | c4d9d19645a484298a67e9021060bc7c2b081d0f | 0 | BlockDriverAIOCB *thread_pool_submit_aio(ThreadPoolFunc *func, void *arg,
BlockDriverCompletionFunc *cb, void *opaque)
{
ThreadPool *pool = &global_pool;
ThreadPoolElement *req;
req = qemu_aio_get(&thread_pool_aiocb_info, NULL, cb, opaque);
req->func = func;
req->arg = arg;
req... | 20,285 |
FFmpeg | a5b4476a602f31e451b11ca0c18bc92be130a50e | 0 | int ff_read_packet(AVFormatContext *s, AVPacket *pkt)
{
int ret, i, err;
AVStream *st;
for (;;) {
AVPacketList *pktl = s->internal->raw_packet_buffer;
if (pktl) {
*pkt = pktl->pkt;
st = s->streams[pkt->stream_index];
if (s->internal->raw_pac... | 20,286 |
qemu | 7a39fe588251ba042c91bf23d53b0ba820bf964c | 0 | int kvm_arch_post_run(CPUState *env, struct kvm_run *run)
{
return 0;
}
| 20,287 |
qemu | 46181129eac9a56d9a948667282dd03d5015f096 | 0 | int bdrv_child_try_set_perm(BdrvChild *c, uint64_t perm, uint64_t shared,
Error **errp)
{
int ret;
ret = bdrv_child_check_perm(c, perm, shared, errp);
if (ret < 0) {
bdrv_child_abort_perm_update(c);
return ret;
}
bdrv_child_set_perm(c, perm, s... | 20,289 |
qemu | 145614a112a8e67d6c84b26faaf2b2002e17d9be | 0 | static gboolean nbd_accept(QIOChannel *ioc, GIOCondition cond, gpointer opaque)
{
QIOChannelSocket *cioc;
cioc = qio_channel_socket_accept(QIO_CHANNEL_SOCKET(ioc),
NULL);
if (!cioc) {
return TRUE;
}
if (state >= TERMINATE) {
object_un... | 20,290 |
qemu | 498f21405a286f718a0767c791b7d2db19f4e5bd | 0 | static int sd_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
{
int ret, fd;
uint32_t vid = 0;
BDRVSheepdogState *s = bs->opaque;
char vdi[SD_MAX_VDI_LEN], tag[SD_MAX_VDI_TAG_LEN];
uint32_t snapid;
char *buf = NULL;
QemuOpts *opts;
Error *... | 20,291 |
qemu | 7f6613cedc59fa849105668ae971dc31004bca1c | 0 | static void gen_cp1 (DisasContext *ctx, uint32_t opc, int rt, int fs)
{
const char *opn = "cp1 move";
TCGv t0 = tcg_temp_new();
switch (opc) {
case OPC_MFC1:
{
TCGv_i32 fp0 = tcg_temp_new_i32();
gen_load_fpr32(fp0, fs);
tcg_gen_ext_i32_tl(t0, fp0)... | 20,292 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void hpet_ram_write(void *opaque, target_phys_addr_t addr,
uint64_t value, unsigned size)
{
int i;
HPETState *s = opaque;
uint64_t old_val, new_val, val, index;
DPRINTF("qemu: Enter hpet_ram_writel at %" PRIx64 " = %#x\n", addr, value);
index = addr;
o... | 20,293 |
qemu | 082c6681b6c4af0035d9dad34a4a784be8c21dbe | 0 | static void init_proc_601 (CPUPPCState *env)
{
gen_spr_ne_601(env);
gen_spr_601(env);
/* Hardware implementation registers */
/* XXX : not implemented */
spr_register(env, SPR_HID0, "HID0",
SPR_NOACCESS, SPR_NOACCESS,
&spr_read_generic, &spr_write_hid0_601,
... | 20,294 |
qemu | 6e0d8677cb443e7408c0b7a25a93c6596d7fa380 | 0 | static inline void gen_stos(DisasContext *s, int ot)
{
gen_op_mov_TN_reg(OT_LONG, 0, R_EAX);
gen_string_movl_A0_EDI(s);
gen_op_st_T0_A0(ot + s->mem_index);
gen_op_movl_T0_Dshift[ot]();
#ifdef TARGET_X86_64
if (s->aflag == 2) {
gen_op_addq_EDI_T0();
} else
#endif
if (s->afl... | 20,295 |
qemu | 0e7106d8b5f7ef4f9df10baf1dfb3db482bcd046 | 0 | static int read_object(int fd, char *buf, uint64_t oid, int copies,
unsigned int datalen, uint64_t offset, bool cache)
{
return read_write_object(fd, buf, oid, copies, datalen, offset, false,
false, cache);
}
| 20,296 |
FFmpeg | 5891e454a667e42ef71a06bfd9661540ea3f3ebd | 0 | static int decode_group3_2d_line(AVCodecContext *avctx, GetBitContext *gb,
unsigned int width, int *runs, const int *runend, const int *ref)
{
int mode = 0, saved_run = 0, t;
int run_off = *ref++;
unsigned int offs=0, run= 0;
runend--; // for the last written 0
... | 20,297 |
qemu | 65afd211c71fc91750d8a18f9604c1e57a5202fb | 0 | static int coroutine_fn bdrv_aligned_preadv(BlockDriverState *bs,
int64_t offset, unsigned int bytes, QEMUIOVector *qiov, int flags)
{
BlockDriver *drv = bs->drv;
BdrvTrackedRequest req;
int ret;
int64_t sector_num = offset >> BDRV_SECTOR_BITS;
unsigned int nb_sectors = bytes >> BDRV_SE... | 20,298 |
qemu | 9e0f5b8108e248b78444c9a2ec41a8309825736c | 0 | void virtio_queue_notify_vq(VirtQueue *vq)
{
if (vq->vring.desc) {
VirtIODevice *vdev = vq->vdev;
trace_virtio_queue_notify(vdev, vq - vdev->vq, vq);
vq->handle_output(vdev, vq);
}
}
| 20,300 |
qemu | d96391c1ffeb30a0afa695c86579517c69d9a889 | 1 | target_ulong helper_rdhwr_performance(CPUMIPSState *env)
{
check_hwrena(env, 4);
return env->CP0_Performance0;
}
| 20,302 |
qemu | af7e9e74c6a62a5bcd911726a9e88d28b61490e0 | 1 | static void openpic_reset(DeviceState *d)
{
OpenPICState *opp = FROM_SYSBUS(typeof (*opp), sysbus_from_qdev(d));
int i;
opp->glbc = GLBC_RESET;
/* Initialise controller registers */
opp->frep = ((opp->nb_irqs - 1) << FREP_NIRQ_SHIFT) |
((opp->nb_cpus - 1) << FREP_NCPU_SHIFT)... | 20,303 |
qemu | 630530a6529bc3da9ab8aead7053dc753cb9ac77 | 1 | static uint64_t get_cluster_offset(BlockDriverState *bs,
uint64_t offset, int allocate)
{
BDRVVmdkState *s = bs->opaque;
unsigned int l1_index, l2_offset, l2_index;
int min_index, i, j;
uint32_t min_count, *l2_table, tmp;
uint64_t cluster_offset;
... | 20,304 |
qemu | 473c7f0255920bcaf37411990a3725898772817f | 1 | static void rbd_aio_bh_cb(void *opaque)
{
RBDAIOCB *acb = opaque;
if (acb->cmd == RBD_AIO_READ) {
qemu_iovec_from_buf(acb->qiov, 0, acb->bounce, acb->qiov->size);
}
qemu_vfree(acb->bounce);
acb->common.cb(acb->common.opaque, (acb->ret > 0 ? 0 : acb->ret));
qemu_bh_delete(acb->b... | 20,306 |
qemu | 34779e8c3991f7fcd74b2045478abcef67dbeb15 | 1 | static void test_tco_second_timeout_shutdown(void)
{
TestData td;
const uint16_t ticks = TCO_SECS_TO_TICKS(128);
QDict *ad;
td.args = "-watchdog-action shutdown";
td.noreboot = false;
test_init(&td);
stop_tco(&td);
clear_tco_status(&td);
reset_on_second_timeout(true);
... | 20,307 |
qemu | 072bdb07c5ef8b0351f9973ab5bba9e76be978a9 | 1 | static void add_ptimer_tests(uint8_t policy)
{
uint8_t *ppolicy = g_malloc(1);
char *policy_name = g_malloc0(256);
*ppolicy = policy;
if (policy == PTIMER_POLICY_DEFAULT) {
g_sprintf(policy_name, "default");
}
if (policy & PTIMER_POLICY_WRAP_AFTER_ONE_PERIOD) {
g_s... | 20,308 |
qemu | 1b3e71f8ee17ced609213d9b41758110f3c026e9 | 1 | void HELPER(entry)(CPUXtensaState *env, uint32_t pc, uint32_t s, uint32_t imm)
{
int callinc = (env->sregs[PS] & PS_CALLINC) >> PS_CALLINC_SHIFT;
if (s > 3 || ((env->sregs[PS] & (PS_WOE | PS_EXCM)) ^ PS_WOE) != 0) {
qemu_log("Illegal entry instruction(pc = %08x), PS = %08x\n",
pc, env->s... | 20,309 |
qemu | 2f448e415f364d0ec4c5556993e44ca183e31c5c | 1 | static void macio_nvram_writeb(void *opaque, hwaddr addr,
uint64_t value, unsigned size)
{
MacIONVRAMState *s = opaque;
addr = (addr >> s->it_shift) & (s->size - 1);
s->data[addr] = value;
NVR_DPRINTF("writeb addr %04" PHYS_PRIx " val %" PRIx64 "\n", addr, value);
... | 20,310 |
qemu | 951053a9ec1c47edf4b2549ef58d82aee8a42a7f | 1 | static int qcow2_do_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
{
BDRVQcow2State *s = bs->opaque;
unsigned int len, i;
int ret = 0;
QCowHeader header;
Error *local_err = NULL;
uint64_t ext_end;
uint64_t l1_vm_state_index;
bool update_heade... | 20,311 |
qemu | 12d4536f7d911b6d87a766ad7300482ea663cea2 | 1 | static void qemu_kvm_init_cpu_signals(CPUState *env)
{
int r;
sigset_t set;
struct sigaction sigact;
memset(&sigact, 0, sizeof(sigact));
sigact.sa_handler = dummy_signal;
sigaction(SIG_IPI, &sigact, NULL);
#ifdef CONFIG_IOTHREAD
pthread_sigmask(SIG_BLOCK, NULL, &set);
sigde... | 20,312 |
qemu | c508277335e3b6b20cf18e6ea3a35c1fa835c64a | 1 | static inline void vmxnet3_ring_write_curr_cell(Vmxnet3Ring *ring, void *buff)
{
vmw_shmem_write(vmxnet3_ring_curr_cell_pa(ring), buff, ring->cell_size);
}
| 20,313 |
FFmpeg | 428098165de4c3edfe42c1b7f00627d287015863 | 1 | static uint16_t roundToInt16(int64_t f){
int r= (f + (1<<15))>>16;
if(r<-0x7FFF) return 0x8000;
else if(r> 0x7FFF) return 0x7FFF;
else return r;
}
| 20,314 |
FFmpeg | 29545741266a03332f2758c7ba4f77f362c3668d | 1 | static int decode_band_hdr(IVI4DecContext *ctx, IVIBandDesc *band,
AVCodecContext *avctx)
{
int plane, band_num, indx, transform_id, scan_indx;
int i;
int quant_mat;
plane = get_bits(&ctx->gb, 2);
band_num = get_bits(&ctx->gb, 4);
if (band->plane != plane ... | 20,315 |
FFmpeg | 323e6fead07c75f418e4b60704a4f437bb3483b2 | 1 | static void scale_coefficients(AC3EncodeContext *s)
{
/* scaling/conversion is obviously not needed for the fixed-point encoder
since the coefficients are already fixed-point. */
return;
}
| 20,316 |
FFmpeg | 29b0d94b43ac960cb442049a5d737a3386ff0337 | 1 | static int decode_dds1(uint8_t *frame, int width, int height,
const uint8_t *src, const uint8_t *src_end)
{
const uint8_t *frame_start = frame;
const uint8_t *frame_end = frame + width * height;
int mask = 0x10000, bitbuf = 0;
int i, v, offset, count, segments;
segm... | 20,317 |
qemu | 7d1b0095bff7157e856d1d0e6c4295641ced2752 | 1 | static void gen_test_cc(int cc, int label)
{
TCGv tmp;
TCGv tmp2;
int inv;
switch (cc) {
case 0: /* eq: Z */
tmp = load_cpu_field(ZF);
tcg_gen_brcondi_i32(TCG_COND_EQ, tmp, 0, label);
break;
case 1: /* ne: !Z */
tmp = load_cpu_field(ZF);
tcg_... | 20,318 |
FFmpeg | 6d2df3c00a7899e9c06e3a460d64e4d0ccde0fae | 1 | static int init_input_threads(void)
{
int i, ret;
if (nb_input_files == 1)
return 0;
for (i = 0; i < nb_input_files; i++) {
InputFile *f = input_files[i];
if (f->ctx->pb ? !f->ctx->pb->seekable :
strcmp(f->ctx->iformat->name, "lavfi"))
f->non_bl... | 20,319 |
FFmpeg | a2f55f22b342202e6925561b9ee0b7ec76e8bcd0 | 0 | static const MXFCodecUL *mxf_get_essence_container_ul(enum CodecID type)
{
const MXFCodecUL *uls = ff_mxf_essence_container_uls;
while (uls->id != CODEC_ID_NONE) {
if (uls->id == type)
break;
uls++;
}
return uls;
}
| 20,322 |
FFmpeg | ac726a4f0cd2fb8619b478af51312a4282215f0e | 0 | static int amovie_request_frame(AVFilterLink *outlink)
{
MovieContext *movie = outlink->src->priv;
int ret;
if (movie->is_done)
return AVERROR_EOF;
do {
if ((ret = amovie_get_samples(outlink)) < 0)
return ret;
} while (!movie->samplesref);
ff_filter_samp... | 20,323 |
FFmpeg | 7373b3ad043cc3417d80c55ccdb620b08cd271bf | 0 | static av_cold int pcm_decode_init(AVCodecContext *avctx)
{
PCMDecode *s = avctx->priv_data;
int i;
if (avctx->channels <= 0) {
av_log(avctx, AV_LOG_ERROR, "PCM channels out of bounds\n");
return AVERROR(EINVAL);
}
switch (avctx->codec->id) {
case AV_CODEC_ID_PCM_ALA... | 20,324 |
FFmpeg | 710940bec16869ff7e07562f1e103e28a84ca316 | 0 | static av_cold int tta_decode_init(AVCodecContext * avctx)
{
TTAContext *s = avctx->priv_data;
int total_frames;
s->avctx = avctx;
// 30bytes includes TTA1 header
if (avctx->extradata_size < 22)
return AVERROR_INVALIDDATA;
init_get_bits(&s->gb, avctx->extradata, avctx->extr... | 20,325 |
FFmpeg | 67afcefb35932b420998f6f3fda46c7c85848a3f | 0 | static void vda_h264_uninit(AVCodecContext *avctx)
{
VDAContext *vda = avctx->internal->priv_data;
av_freep(&vda->bitstream);
}
| 20,326 |
qemu | 5be5f9be724d43fbec3d6f955a43bc64a62d55cc | 1 | int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
VhostBackendType backend_type, uint32_t busyloop_timeout)
{
uint64_t features;
int i, r;
hdev->migration_blocker = NULL;
r = vhost_set_backend_type(hdev, backend_type);
assert(r >= 0);
r = hdev->vhost_ops->... | 20,329 |
FFmpeg | 8df8a87e3fd5bd0c3dabc676aae8fd84992932dc | 1 | static void cmv_process_header(CmvContext *s, const uint8_t *buf, const uint8_t *buf_end)
{
int pal_start, pal_count, i;
if(buf+16>=buf_end) {
av_log(s->avctx, AV_LOG_WARNING, "truncated header\n");
return;
}
s->width = AV_RL16(&buf[4]);
s->height = AV_RL16(&buf[6]);
... | 20,330 |
qemu | 81bf96d3d299a7f88bf3e2ece4f795a9949db5f7 | 1 | static int usb_serial_initfn(USBDevice *dev)
{
USBSerialState *s = DO_UPCAST(USBSerialState, dev, dev);
s->dev.speed = USB_SPEED_FULL;
qemu_chr_add_handlers(s->cs, usb_serial_can_read, usb_serial_read,
usb_serial_event, s);
usb_serial_handle_reset(dev);
return 0; | 20,331 |
qemu | 3e305e4a4752f70c0b5c3cf5b43ec957881714f7 | 1 | static ssize_t vnc_client_write_tls(gnutls_session_t *session,
const uint8_t *data,
size_t datalen)
{
ssize_t ret = gnutls_write(*session, data, datalen);
if (ret < 0) {
if (ret == GNUTLS_E_AGAIN) {
errno = EAGAIN... | 20,332 |
qemu | 95204aa951ceb28eb6d4ce43bce09a58cbad83d8 | 1 | ivshmem_client_handle_server_msg(IvshmemClient *client)
{
IvshmemClientPeer *peer;
long peer_id;
int ret, fd;
ret = ivshmem_client_read_one_msg(client, &peer_id, &fd);
if (ret < 0) {
/* can return a peer or the local client */
peer = ivshmem_client_search_peer(client, peer_id);
/* delete... | 20,333 |
FFmpeg | 9487fb4dea3498eb4711eb023f43199f68701b1e | 1 | yuv2422_2_c_template(SwsContext *c, const int16_t *buf[2],
const int16_t *ubuf[2], const int16_t *vbuf[2],
const int16_t *abuf[2], uint8_t *dest, int dstW,
int yalpha, int uvalpha, int y,
enum PixelFormat target)
{
const int16_t *bu... | 20,334 |
FFmpeg | cba92a2226151abf0e3c24ed594e127203d485b8 | 1 | static int vobsub_read_packet(AVFormatContext *s, AVPacket *pkt)
{
MpegDemuxContext *vobsub = s->priv_data;
FFDemuxSubtitlesQueue *q;
AVIOContext *pb = vobsub->sub_ctx->pb;
int ret, psize, total_read = 0, i;
AVPacket idx_pkt;
int64_t min_ts = INT64_MAX;
int sid = 0;
for (i = 0... | 20,335 |
FFmpeg | 47f1596ecef3304f20be1be2dc6978989334608f | 1 | static int dxtory_decode_v1_410(AVCodecContext *avctx, AVFrame *pic,
const uint8_t *src, int src_size)
{
int h, w;
uint8_t *Y1, *Y2, *Y3, *Y4, *U, *V;
int ret;
if (src_size < avctx->width * avctx->height * 9L / 8) {
av_log(avctx, AV_LOG_ERROR, "packet too... | 20,336 |
FFmpeg | a417d041f03d725b0e159136e063538f0cee786a | 0 | static void dnxhd_decode_dct_block(DNXHDContext *ctx, DCTELEM *block, int n, int qscale)
{
int i, j, index, index2;
int level, component, sign;
const uint8_t *weigth_matrix;
if (n&2) {
component = 1 + (n&1);
weigth_matrix = ctx->cid_table->chroma_weigth;
} else {
c... | 20,337 |
FFmpeg | 29ba091136a5e04574f7bfc1b17536c923958f6f | 0 | const char *avutil_configuration(void)
{
return FFMPEG_CONFIGURATION;
}
| 20,339 |
qemu | efec3dd631d94160288392721a5f9c39e50fb2bc | 1 | static void i8042_class_initfn(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
dc->realize = i8042_realizefn;
dc->no_user = 1;
dc->vmsd = &vmstate_kbd_isa;
}
| 20,340 |
FFmpeg | fed92adbb3fc6cbf735e3df9a2f7d0a2917fcfbd | 1 | int vp78_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
AVPacket *avpkt, int is_vp7)
{
VP8Context *s = avctx->priv_data;
int ret, i, referenced, num_jobs;
enum AVDiscard skip_thresh;
VP8Frame *av_uninit(curframe), *prev_frame;
if (is_vp7)
ret ... | 20,341 |
FFmpeg | e211e255aa399d68239ffa42c9cc7a52eb3d55a9 | 1 | void ff_bink_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block)
{
int i;
DCTELEM temp[64];
for (i = 0; i < 8; i++)
bink_idct_col(&temp[i], &block[i]);
for (i = 0; i < 8; i++) {
IDCT_ROW( (&dest[i*linesize]), (&temp[8*i]) );
}
}
| 20,342 |
qemu | 60fe637bf0e4d7989e21e50f52526444765c63b4 | 1 | static void qemu_rdma_signal_unregister(RDMAContext *rdma, uint64_t index,
uint64_t chunk, uint64_t wr_id)
{
if (rdma->unregistrations[rdma->unregister_next] != 0) {
fprintf(stderr, "rdma migration: queue is full!\n");
} else {
RDMALocalBlock *block ... | 20,343 |
qemu | fff39a7ad09da07ef490de05c92c91f22f8002f2 | 1 | static void v9fs_unlinkat(void *opaque)
{
int err = 0;
V9fsString name;
int32_t dfid, flags;
size_t offset = 7;
V9fsPath path;
V9fsFidState *dfidp;
V9fsPDU *pdu = opaque;
v9fs_string_init(&name);
err = pdu_unmarshal(pdu, offset, "dsd", &dfid, &name, &flags);
if (err < 0) {
df... | 20,344 |
qemu | 768a9ebe188bd0a6172a9a4e64777d21fff7f014 | 1 | static int parse_pci_devfn(DeviceState *dev, Property *prop, const char *str)
{
uint32_t *ptr = qdev_get_prop_ptr(dev, prop);
unsigned int slot, fn, n;
if (sscanf(str, "%x.%x%n", &slot, &fn, &n) != 2) {
fn = 0;
if (sscanf(str, "%x%n", &slot, &n) != 1) {
return -EINVAL;
... | 20,346 |
FFmpeg | c898431ca5ef2a997fe9388b650f658fb60783e5 | 1 | static int nsv_read_header(AVFormatContext *s)
{
NSVContext *nsv = s->priv_data;
int i, err;
av_dlog(s, "%s()\n", __FUNCTION__);
av_dlog(s, "filename '%s'\n", s->filename);
nsv->state = NSV_UNSYNC;
nsv->ahead[0].data = nsv->ahead[1].data = NULL;
for (i = 0; i < NSV_MAX_RESYNC_T... | 20,347 |
qemu | 36be0929f53260cb9b1e2720c7c22f6b5fb5910f | 1 | static void cd_read_sector_cb(void *opaque, int ret)
{
IDEState *s = opaque;
block_acct_done(blk_get_stats(s->blk), &s->acct);
#ifdef DEBUG_IDE_ATAPI
printf("cd_read_sector_cb: lba=%d ret=%d\n", s->lba, ret);
#endif
if (ret < 0) {
ide_atapi_io_error(s, ret);
return;
}... | 20,348 |
qemu | 7364dbdabb7824d5bde1e341bb6d928282f01c83 | 1 | static void vnc_tls_handshake_done(QIOTask *task,
gpointer user_data)
{
VncState *vs = user_data;
Error *err = NULL;
if (qio_task_propagate_error(task, &err)) {
VNC_DEBUG("Handshake failed %s\n",
error_get_pretty(err));
vnc_clien... | 20,349 |
FFmpeg | 08797c599df5371909f6924d732b654f8892cc91 | 0 | static int get_best_header(FLACParseContext* fpc, const uint8_t **poutbuf,
int *poutbuf_size)
{
FLACHeaderMarker *header = fpc->best_header;
FLACHeaderMarker *child = header->best_child;
if (!child) {
*poutbuf_size = av_fifo_size(fpc->fifo_buf) - header->offset;
... | 20,350 |
FFmpeg | dd6c8575dbc8d3ff5dc2ffacb5028c253066ff78 | 0 | static int decode_packet(int *got_frame, int cached)
{
int ret = 0;
int decoded = pkt.size;
*got_frame = 0;
if (pkt.stream_index == video_stream_idx) {
/* decode video frame */
ret = avcodec_decode_video2(video_dec_ctx, frame, got_frame, &pkt);
if (ret < 0) {
... | 20,351 |
FFmpeg | 0105ed551cb9610c62b6920a301125781e1161a0 | 0 | void ff_avg_h264_qpel16_mc00_msa(uint8_t *dst, const uint8_t *src,
ptrdiff_t stride)
{
avg_width16_msa(src, stride, dst, stride, 16);
}
| 20,353 |
FFmpeg | 38d7cc22f7782de2e7aca8eda2c2c2996f7f5700 | 0 | static inline int init_pfa_reindex_tabs(MDCT15Context *s)
{
int i, j;
const int b_ptwo = s->ptwo_fft.nbits; /* Bits for the power of two FFTs */
const int l_ptwo = 1 << b_ptwo; /* Total length for the power of two FFTs */
const int inv_1 = l_ptwo << ((4 - b_ptwo) & 3); /* (2^b_ptwo)^-1 mod 15 */
... | 20,354 |
FFmpeg | 0c1959b056f6ccaa2eee2c824352ba93c8e36d52 | 0 | static void mxf_write_identification(AVFormatContext *s)
{
MXFContext *mxf = s->priv_data;
AVIOContext *pb = s->pb;
const char *company = "Libav";
const char *product = "OP1a Muxer";
const char *version;
int length;
mxf_write_metadata_key(pb, 0x013000);
PRINT_KEY(s, "identific... | 20,355 |
qemu | b3db211f3c80bb996a704d665fe275619f728bd4 | 0 | static void test_visitor_out_native_list_uint32(TestOutputVisitorData *data,
const void *unused)
{
test_native_list(data, unused, USER_DEF_NATIVE_LIST_UNION_KIND_U32);
}
| 20,356 |
qemu | 85c34e9395a97e49def6697537417ead2077c096 | 0 | static void ahci_test_identify(AHCIQState *ahci)
{
RegD2HFIS *d2h = g_malloc0(0x20);
RegD2HFIS *pio = g_malloc0(0x20);
RegH2DFIS fis;
AHCICommandHeader cmd;
PRD prd;
uint32_t reg, data_ptr;
uint16_t buff[256];
unsigned i;
int rc;
uint8_t cx;
uint64_t table;
... | 20,357 |
FFmpeg | e30a28468794efdfa8fcadf54ef14ff39736166b | 0 | void opt_output_file(const char *filename)
{
AVStream *st;
AVFormatContext *oc;
int use_video, use_audio, nb_streams, input_has_video, input_has_audio;
int codec_id;
if (!strcmp(filename, "-"))
filename = "pipe:";
oc = av_mallocz(sizeof(AVFormatContext));
if (!file_for... | 20,358 |
qemu | cd1ba7de230b3a85fb4dba53bb681b7ea626b4eb | 0 | int xen_hvm_init(void)
{
int i, rc;
unsigned long ioreq_pfn;
XenIOState *state;
state = g_malloc0(sizeof (XenIOState));
state->xce_handle = xen_xc_evtchn_open(NULL, 0);
if (state->xce_handle == XC_HANDLER_INITIAL_VALUE) {
perror("xen: event channel open");
return -er... | 20,359 |
qemu | e3f5ec2b5e92706e3b807059f79b1fb5d936e567 | 0 | static void nic_receive(void *opaque, const uint8_t * buf, size_t size)
{
/* TODO:
* - Magic packets should set bit 30 in power management driver register.
* - Interesting packets should set bit 29 in power management driver register.
*/
EEPRO100State *s = opaque;
uint16_t rfd_status =... | 20,360 |
qemu | bec1631100323fac0900aea71043d5c4e22fc2fa | 0 | static inline void tcg_out_brcond(TCGContext *s, TCGCond cond, TCGReg arg1,
TCGReg arg2, int label_index, int cmp4)
{
TCGLabel *l = &s->labels[label_index];
uint64_t imm;
/* We pay attention here to not modify the branch target by reading
the existing value a... | 20,361 |
qemu | f37f29d31488fe36354e59b2fdc4fae83b2cf763 | 0 | static int handle_buffered_iopage(XenIOState *state)
{
buffered_iopage_t *buf_page = state->buffered_io_page;
buf_ioreq_t *buf_req = NULL;
ioreq_t req;
int qw;
if (!buf_page) {
return 0;
}
memset(&req, 0x00, sizeof(req));
for (;;) {
uint32_t rdptr = buf_p... | 20,362 |
qemu | d1b4259f1ab18af24e6a297edb6a8f71691f3256 | 0 | void virtio_bus_device_plugged(VirtIODevice *vdev, Error **errp)
{
DeviceState *qdev = DEVICE(vdev);
BusState *qbus = BUS(qdev_get_parent_bus(qdev));
VirtioBusState *bus = VIRTIO_BUS(qbus);
VirtioBusClass *klass = VIRTIO_BUS_GET_CLASS(bus);
VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(vdev... | 20,363 |
qemu | c2b38b277a7882a592f4f2ec955084b2b756daaa | 0 | GSource *aio_get_g_source(AioContext *ctx)
{
g_source_ref(&ctx->source);
return &ctx->source;
}
| 20,364 |
FFmpeg | 5fd7a9fcdf472e957b0c2f453f13d7f33e07a4a5 | 0 | static int decode_frame_mp3on4(AVCodecContext * avctx,
void *data, int *data_size,
const uint8_t * buf, int buf_size)
{
MP3On4DecodeContext *s = avctx->priv_data;
MPADecodeContext *m;
int len, out_size = 0;
uint32_t header;
OUT_INT *out_samples... | 20,369 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.