project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
FFmpeg | a6e14edde01bafbbe54f6f451efa718a48975b47 | 1 | static int http_receive_data(HTTPContext *c)
{
int len;
HTTPContext *c1;
if (c->buffer_ptr >= c->buffer_end) {
FFStream *feed = c->stream;
/* a packet has been received : write it in the store, except
if header */
if (c->data_count > FFM_PACKET_SIZE) {
... | 376 |
qemu | b45c03f585ea9bb1af76c73e82195418c294919d | 1 | static int stellaris_sys_init(uint32_t base, qemu_irq irq,
stellaris_board_info * board,
uint8_t *macaddr)
{
ssys_state *s;
s = (ssys_state *)g_malloc0(sizeof(ssys_state));
s->irq = irq;
s->board = board;
/* Most devices come prep... | 377 |
qemu | 11748ba72ea4fc03e975aa5f5d876b5b0902e356 | 1 | static int kvm_recommended_vcpus(KVMState *s)
{
int ret = kvm_check_extension(s, KVM_CAP_NR_VCPUS);
return (ret) ? ret : 4;
}
| 379 |
qemu | c3adb5b9168a57790b5074489b6f0275ac3cc8b5 | 1 | static void reschedule_dma(void *opaque)
{
DMAAIOCB *dbs = (DMAAIOCB *)opaque;
qemu_bh_delete(dbs->bh);
dbs->bh = NULL;
dma_bdrv_cb(opaque, 0);
}
| 380 |
FFmpeg | e457023a95e449ac2c80a49256f0611d5a8fffff | 1 | static int adpcm_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
ADPCMContext *c = avctx->priv_data;
ADPCMChannelStatus *cs;
int n, m, channel, i;
int block_predictor[2];
short *samples;
... | 381 |
qemu | fb0c43f34eed8b18678c6e1f481d8564b35c99ed | 1 | static coroutine_fn void test_multi_co_schedule_entry(void *opaque)
{
g_assert(to_schedule[id] == NULL);
atomic_mb_set(&to_schedule[id], qemu_coroutine_self());
while (!atomic_mb_read(&now_stopping)) {
int n;
n = g_test_rand_int_range(0, NUM_CONTEXTS);
schedule_next(n);
... | 382 |
qemu | d66e5cee002c471b78139228a4e7012736b375f9 | 1 | static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
{
BDRVQcowState *s = bs->opaque;
int len, i, shift, ret;
QCowHeader header;
ret = bdrv_pread(bs->file, 0, &header, sizeof(header));
if (ret < 0) {
goto fail;
}
be32_to... | 383 |
FFmpeg | ac87c273a646eb8feba8e47f15da4934d119f650 | 1 | static AVFilterBufferRef *copy_buffer_ref(AVFilterContext *ctx,
AVFilterBufferRef *ref)
{
AVFilterLink *outlink = ctx->outputs[0];
AVFilterBufferRef *buf;
int channels, data_size, i;
switch (outlink->type) {
case AVMEDIA_TYPE_VIDEO:
buf =... | 384 |
qemu | d5208c45be38ab858db6ec5a5097aa1c1a8ebbc9 | 1 | void qmp_block_commit(const char *device,
bool has_base, const char *base, const char *top,
bool has_speed, int64_t speed,
Error **errp)
{
BlockDriverState *bs;
BlockDriverState *base_bs, *top_bs;
Error *local_err = NULL;
/* This ... | 385 |
FFmpeg | 843e72ea5542845a0a9fed743517c14a92279885 | 0 | static int mkv_check_tag(AVDictionary *m)
{
AVDictionaryEntry *t = NULL;
while ((t = av_dict_get(m, "", t, AV_DICT_IGNORE_SUFFIX)))
if (av_strcasecmp(t->key, "title") && av_strcasecmp(t->key, "stereo_mode"))
return 1;
return 0;
}
| 386 |
FFmpeg | cc13bc8c4f0f4afa30d0b94c3f3a369ccd2aaf0b | 0 | int ff_h2645_extract_rbsp(const uint8_t *src, int length,
H2645NAL *nal)
{
int i, si, di;
uint8_t *dst;
nal->skipped_bytes = 0;
#define STARTCODE_TEST \
if (i + 2 < length && src[i + 1] == 0 && src[i + 2] <= 3) { ... | 387 |
FFmpeg | 7da9f4523159670d577a2808d4481e64008a8894 | 1 | static int encode_mode(CinepakEncContext *s, CinepakMode mode, int h, int v1_size, int v4_size, int v4, AVPicture *scratch_pict, strip_info *info, unsigned char *buf)
{
int x, y, z, flags, bits, temp_size, header_ofs, ret = 0, mb_count = s->w * h / MB_AREA;
int needs_extra_bit, should_write_temp;
unsign... | 388 |
FFmpeg | a443a2530d00b7019269202ac0f5ca8ba0a021c7 | 1 | static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap)
{
ByteIOContext *pb = &s->pb;
SmackerContext *smk = (SmackerContext *)s->priv_data;
AVStream *st, *ast[7];
int i, ret;
int tbase;
/* read and check header */
smk->magic = get_le32(pb);
if (smk->magic != MKTAG('S',... | 389 |
qemu | c25a67f0c3d0c86231f9653267a222c4effa706f | 1 | static void pci_edu_realize(PCIDevice *pdev, Error **errp)
{
EduState *edu = DO_UPCAST(EduState, pdev, pdev);
uint8_t *pci_conf = pdev->config;
timer_init_ms(&edu->dma_timer, QEMU_CLOCK_VIRTUAL, edu_dma_timer, edu);
qemu_mutex_init(&edu->thr_mutex);
qemu_cond_init(&edu->thr_cond);
qem... | 392 |
qemu | 9b79a76cdbb43b0b00aaf6e9421298842fc68841 | 1 | uint64_t pc_dimm_get_free_addr(uint64_t address_space_start,
uint64_t address_space_size,
uint64_t *hint, uint64_t size,
Error **errp)
{
GSList *list = NULL, *item;
uint64_t new_addr, ret = 0;
uint64_t addres... | 393 |
FFmpeg | ec8a4841f7e81040f9a2757f23e70dff5e6b33a4 | 1 | static int wma_decode_block(WMACodecContext *s)
{
int n, v, a, ch, bsize;
int coef_nb_bits, total_gain;
int nb_coefs[MAX_CHANNELS];
float mdct_norm;
FFTContext *mdct;
#ifdef TRACE
tprintf(s->avctx, "***decode_block: %d:%d\n", s->frame_count - 1, s->block_num);
#endif
/* compute... | 394 |
qemu | e17408283562be359f16a7e12ddfee7509d6fe11 | 0 | static int floppy_probe_device(const char *filename)
{
int fd, ret;
int prio = 0;
struct floppy_struct fdparam;
struct stat st;
if (strstart(filename, "/dev/fd", NULL))
prio = 50;
fd = open(filename, O_RDONLY | O_NONBLOCK);
if (fd < 0) {
goto out;
}
re... | 397 |
qemu | 72cf2d4f0e181d0d3a3122e04129c58a95da713e | 0 | struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev)
{
struct XenDevice *xendev;
TAILQ_FOREACH(xendev, &xendevs, next) {
if (xendev->dom != dom)
continue;
if (xendev->dev != dev)
continue;
if (strcmp(xendev->type, type) != 0)
continue;
return xendev;
}
... | 398 |
FFmpeg | f12e206b4737b84afa6071f4b464664a50b0c916 | 0 | static void dct_unquantize_mpeg1_mmx(MpegEncContext *s,
DCTELEM *block, int n, int qscale)
{
int i, level;
const UINT16 *quant_matrix;
if (s->mb_intra) {
if (n < 4)
block[0] = block[0] * s->y_dc_scale;
else
block[0] = blo... | 400 |
qemu | b1914b824ade1706847428e64ef5637ffc0ae238 | 0 | static int virtio_ccw_set_vqs(SubchDev *sch, VqInfoBlock *info,
VqInfoBlockLegacy *linfo)
{
VirtIODevice *vdev = virtio_ccw_get_vdev(sch);
uint16_t index = info ? info->index : linfo->index;
uint16_t num = info ? info->num : linfo->num;
uint64_t desc = info ? info->de... | 401 |
qemu | 83f338f73ecb88cc6f85d6e7b81ebef112ce07be | 0 | void qemu_system_debug_request(void)
{
debug_requested = 1;
vm_stop(VMSTOP_DEBUG);
}
| 403 |
qemu | a03ef88f77af045a2eb9629b5ce774a3fb973c5e | 0 | static int coroutine_fn raw_co_pwrite_zeroes(BlockDriverState *bs,
int64_t offset, int count,
BdrvRequestFlags flags)
{
return bdrv_co_pwrite_zeroes(bs->file->bs, offset, count, flags);
}
| 405 |
qemu | 871271615108fd58273423d98b7cefe08e6f75a0 | 0 | void monitor_flush(Monitor *mon)
{
int i;
if (term_outbuf_index > 0) {
for (i = 0; i < MAX_MON; i++)
if (monitor_hd[i] && monitor_hd[i]->focus == 0)
qemu_chr_write(monitor_hd[i], term_outbuf, term_outbuf_index);
term_outbuf_index = 0;
}
}
| 406 |
qemu | 28f082469650a0f4c0e37b4ccd6f9514b1a0698d | 0 | void qemu_co_queue_restart_all(CoQueue *queue)
{
while (qemu_co_queue_next(queue)) {
/* Do nothing */
}
}
| 407 |
qemu | 12f86b5b3e1bdf75e0a467d771c16cc42f3a1f1a | 0 | static void nvdimm_dsm_func_read_fit(AcpiNVDIMMState *state, NvdimmDsmIn *in,
hwaddr dsm_mem_addr)
{
NvdimmFitBuffer *fit_buf = &state->fit_buf;
NvdimmFuncReadFITIn *read_fit;
NvdimmFuncReadFITOut *read_fit_out;
GArray *fit;
uint32_t read_len = 0, func_ret... | 408 |
qemu | 5379229a2708df3a1506113315214c3ce5325859 | 0 | static void tftp_send_error(struct tftp_session *spt,
uint16_t errorcode, const char *msg,
struct tftp_t *recv_tp)
{
struct sockaddr_in saddr, daddr;
struct mbuf *m;
struct tftp_t *tp;
m = m_get(spt->slirp);
if (!m) {
goto out;
}
... | 409 |
qemu | a89f364ae8740dfc31b321eed9ee454e996dc3c1 | 0 | static void omap_rtc_alarm_update(struct omap_rtc_s *s)
{
s->alarm_ti = mktimegm(&s->alarm_tm);
if (s->alarm_ti == -1)
printf("%s: conversion failed\n", __FUNCTION__);
}
| 410 |
FFmpeg | 33d6f90e3e0241939ea0be9ca9e1f335942081c8 | 0 | static int http_send_data(HTTPContext *c)
{
int len, ret;
for(;;) {
if (c->buffer_ptr >= c->buffer_end) {
ret = http_prepare_data(c);
if (ret < 0)
return -1;
else if (ret != 0)
/* state change requested */
br... | 411 |
qemu | 37f51384ae05bd50f83308339dbffa3e78404874 | 0 | static inline bool vtd_iova_range_check(uint64_t iova, VTDContextEntry *ce)
{
/*
* Check if @iova is above 2^X-1, where X is the minimum of MGAW
* in CAP_REG and AW in context-entry.
*/
return !(iova & ~(vtd_iova_limit(ce) - 1));
}
| 412 |
qemu | 3dc6f8693694a649a9c83f1e2746565b47683923 | 0 | DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type)
{
const char *value;
BlockBackend *blk;
DriveInfo *dinfo = NULL;
QDict *bs_opts;
QemuOpts *legacy_opts;
DriveMediaType media = MEDIA_DISK;
BlockInterfaceType type;
int cyls, heads, secs, translation;... | 413 |
qemu | cde0fc7544ca590c83f349d4dcccf375d55d6042 | 0 | void qerror_report_internal(const char *file, int linenr, const char *func,
const char *fmt, ...)
{
va_list va;
QError *qerror;
va_start(va, fmt);
qerror = qerror_from_info(file, linenr, func, fmt, &va);
va_end(va);
if (cur_mon) {
monitor_set_erro... | 414 |
qemu | 7a7aae21ccab06606cee9aba846d2e30cb616763 | 0 | static void qdev_prop_set(DeviceState *dev, const char *name, void *src, enum PropertyType type)
{
Property *prop;
prop = qdev_prop_find(dev, name);
if (!prop) {
fprintf(stderr, "%s: property \"%s.%s\" not found\n",
__FUNCTION__, object_get_typename(OBJECT(dev)), name);
... | 415 |
qemu | 4be746345f13e99e468c60acbd3a355e8183e3ce | 0 | void qdev_prop_set_drive_nofail(DeviceState *dev, const char *name,
BlockDriverState *value)
{
if (qdev_prop_set_drive(dev, name, value) < 0) {
exit(1);
}
}
| 416 |
qemu | fd56e0612b6454a282fa6a953fdb09281a98c589 | 0 | static int piix3_post_load(void *opaque, int version_id)
{
PIIX3State *piix3 = opaque;
int pirq;
/* Because the i8259 has not been deserialized yet, qemu_irq_raise
* might bring the system to a different state than the saved one;
* for example, the interrupt could be masked but the i8259 w... | 417 |
qemu | 2119882c7eb7e2c612b24fc0c8d86f5887d6f1c3 | 0 | static void unset_dirty_tracking(void)
{
BlkMigDevState *bmds;
QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) {
aio_context_acquire(blk_get_aio_context(bmds->blk));
bdrv_release_dirty_bitmap(blk_bs(bmds->blk), bmds->dirty_bitmap);
aio_context_release(blk_get_aio_contex... | 418 |
qemu | eef5ad1086403d8ac8d91208a0e8dc34734b671c | 0 | static void cb_hmp_change_bdrv_pwd(Monitor *mon, const char *password,
void *opaque)
{
Error *encryption_err = opaque;
Error *err = NULL;
const char *device;
device = error_get_field(encryption_err, "device");
qmp_block_passwd(device, password, &err);
... | 419 |
FFmpeg | 6202e2fede75df92cbc374a3f7d6893d0c5ac721 | 0 | av_cold int ff_ivi_decode_close(AVCodecContext *avctx)
{
IVI45DecContext *ctx = avctx->priv_data;
ivi_free_buffers(&ctx->planes[0]);
if (ctx->mb_vlc.cust_tab.table)
ff_free_vlc(&ctx->mb_vlc.cust_tab);
#if IVI4_STREAM_ANALYSER
if (ctx->is_indeo4) {
if (ctx->is_scalable)
... | 421 |
FFmpeg | 3b199d29cd597a3518136d78860e172060b9e83d | 0 | static av_cold int cinepak_decode_init(AVCodecContext *avctx)
{
CinepakContext *s = avctx->priv_data;
s->avctx = avctx;
s->width = (avctx->width + 3) & ~3;
s->height = (avctx->height + 3) & ~3;
s->sega_film_skip_bytes = -1; /* uninitialized state */
// check for paletted data
if... | 422 |
qemu | 599d0c45615b7d099d256738a586d0f63bc707e6 | 1 | static int xen_host_pci_config_open(XenHostPCIDevice *d)
{
char path[PATH_MAX];
int rc;
rc = xen_host_pci_sysfs_path(d, "config", path, sizeof (path));
if (rc) {
return rc;
}
d->config_fd = open(path, O_RDWR);
if (d->config_fd < 0) {
return -errno;
}
ret... | 423 |
qemu | cba7054928b10a7fda57c64807451bbc9a31e42e | 1 | void cpu_exec_init(CPUArchState *env)
{
CPUState *cpu = ENV_GET_CPU(env);
CPUClass *cc = CPU_GET_CLASS(cpu);
CPUState *some_cpu;
int cpu_index;
#if defined(CONFIG_USER_ONLY)
cpu_list_lock();
#endif
cpu_index = 0;
CPU_FOREACH(some_cpu) {
cpu_index++;
}
cpu->cpu_... | 424 |
qemu | c4843a45e3d4f3698b214275ab5e78cdb6a3d212 | 1 | static int vhost_set_vring_file(struct vhost_dev *dev,
VhostUserRequest request,
struct vhost_vring_file *file)
{
int fds[VHOST_MEMORY_MAX_NREGIONS];
size_t fd_num = 0;
VhostUserMsg msg = {
.request = request,
.flags = V... | 425 |
qemu | 11b7b07f8a15879134a54e73fade98d5e11e04f8 | 1 | char *qdist_pr(const struct qdist *dist, size_t n_bins, uint32_t opt)
{
const char *border = opt & QDIST_PR_BORDER ? "|" : "";
char *llabel, *rlabel;
char *hgram;
GString *s;
if (dist->n == 0) {
return NULL;
}
s = g_string_new("");
llabel = qdist_pr_label(dist, n_... | 426 |
qemu | 60fe637bf0e4d7989e21e50f52526444765c63b4 | 1 | static int qemu_rdma_write_one(QEMUFile *f, RDMAContext *rdma,
int current_index, uint64_t current_addr,
uint64_t length)
{
struct ibv_sge sge;
struct ibv_send_wr send_wr = { 0 };
struct ibv_send_wr *bad_wr;
int reg_result_idx, ret, co... | 428 |
qemu | 2dedf83ef0cc3463783d6b71bf1b25476f691f3a | 1 | static int init_directories(BDRVVVFATState* s,
const char* dirname)
{
bootsector_t* bootsector;
mapping_t* mapping;
unsigned int i;
unsigned int cluster;
memset(&(s->first_sectors[0]),0,0x40*0x200);
s->cluster_size=s->sectors_per_cluster*0x200;
s->cluster_buffer=qemu_malloc(s->... | 429 |
FFmpeg | 1bbb18fe82fc77a10d45fa53bd2738d2c54de6c6 | 1 | static int mpegts_read_header(AVFormatContext *s)
{
MpegTSContext *ts = s->priv_data;
AVIOContext *pb = s->pb;
uint8_t buf[8 * 1024] = {0};
int len;
int64_t pos, probesize = s->probesize;
if (ffio_ensure_seekback(pb, probesize) < 0)
av_log(s, AV_LOG_WARNING, "Failed to alloca... | 430 |
qemu | 9a75b0a037e3a8030992244353f17b62f6daf2ab | 1 | static QPCIDevice *get_ahci_device(uint32_t *fingerprint)
{
QPCIDevice *ahci;
uint32_t ahci_fingerprint;
QPCIBus *pcibus;
pcibus = qpci_init_pc();
/* Find the AHCI PCI device and verify it's the right one. */
ahci = qpci_device_find(pcibus, QPCI_DEVFN(0x1F, 0x02));
g_assert(ahci ... | 431 |
qemu | 69dd5c9ffd5c0c6a01ad14b9c6a8d7135ccc2b9a | 1 | static int protocol_client_msg(VncState *vs, uint8_t *data, size_t len)
{
int i;
uint16_t limit;
switch (data[0]) {
case 0:
if (len == 1)
return 20;
set_pixel_format(vs, read_u8(data, 4), read_u8(data, 5),
read_u8(data, 6), read_u8(data, 7),
read_u16(data, 8), read_u16(data,... | 432 |
FFmpeg | 2002436b0c914e18eda4f45ef816b14501a1dbae | 1 | static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
AVPacket *avpkt) {
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
AVSubtitle *sub = data;
const uint8_t *buf_end = buf + buf_size;
uint8_t *bitmap;
int w, h, x, y, i, ret;
int64_... | 433 |
qemu | 9dfd24ed848228643293e37c36848b5ac520ab98 | 1 | static void tpm_tis_initfn(Object *obj)
{
ISADevice *dev = ISA_DEVICE(obj);
TPMState *s = TPM(obj);
memory_region_init_io(&s->mmio, OBJECT(s), &tpm_tis_memory_ops,
s, "tpm-tis-mmio",
TPM_TIS_NUM_LOCALITIES << TPM_TIS_LOCALITY_SHIFT);
memory_re... | 434 |
FFmpeg | a4d18a3f54e5b0277234d8fcff65dff8516417a0 | 1 | static int process_frame(FFFrameSync *fs)
{
AVFilterContext *ctx = fs->parent;
LUT2Context *s = fs->opaque;
AVFilterLink *outlink = ctx->outputs[0];
AVFrame *out, *srcx, *srcy;
int ret;
if ((ret = ff_framesync2_get_frame(&s->fs, 0, &srcx, 0)) < 0 ||
(ret = ff_framesync2_get_fra... | 435 |
qemu | 6ce310b5356abb7edc3aa8b8b097d0b8cc76f83f | 1 | static int handle_primary_tcp_pkt(NetFilterState *nf,
Connection *conn,
Packet *pkt)
{
struct tcphdr *tcp_pkt;
tcp_pkt = (struct tcphdr *)pkt->transport_header;
if (trace_event_get_state_backends(TRACE_COLO_FILTER_REWRITER_DEBUG)) {... | 437 |
FFmpeg | 70d54392f5015b9c6594fcae558f59f952501e3b | 0 | av_cold void ff_dsputil_init_armv6(DSPContext *c, AVCodecContext *avctx)
{
const int high_bit_depth = avctx->bits_per_raw_sample > 8;
if (avctx->bits_per_raw_sample <= 8 &&
(avctx->idct_algo == FF_IDCT_AUTO ||
avctx->idct_algo == FF_IDCT_SIMPLEARMV6)) {
c->idct_put ... | 438 |
FFmpeg | 0058584580b87feb47898e60e4b80c7f425882ad | 0 | static int decode_exponents(AC3DecodeContext *ctx)
{
ac3_audio_block *ab = &ctx->audio_block;
int i;
uint8_t *exps;
uint8_t *dexps;
if (ab->flags & AC3_AB_CPLINU && ab->cplexpstr != AC3_EXPSTR_REUSE)
if (_decode_exponents(ab->cplexpstr, ab->ncplgrps, ab->cplabsexp,
... | 440 |
qemu | c599d4d6d6e9bfdb64e54c33a22cb26e3496b96d | 1 | static void handle_pending_signal(CPUArchState *cpu_env, int sig,
struct emulated_sigtable *k)
{
CPUState *cpu = ENV_GET_CPU(cpu_env);
abi_ulong handler;
sigset_t set;
target_sigset_t target_old_set;
struct target_sigaction *sa;
TaskState *ts = cpu->opaq... | 441 |
qemu | 356f59b8757f47c0aca3e2e4e51d6010f64cade1 | 1 | void block_job_yield(BlockJob *job)
{
assert(job->busy);
/* Check cancellation *before* setting busy = false, too! */
if (block_job_is_cancelled(job)) {
return;
}
job->busy = false;
if (!block_job_should_pause(job)) {
qemu_coroutine_yield();
}
job->busy = ... | 442 |
FFmpeg | 9b7a8bddac52bd05dddb28afd4dff92739946d3b | 1 | static int udp_close(URLContext *h)
{
UDPContext *s = h->priv_data;
if (s->is_multicast && (h->flags & AVIO_FLAG_READ))
udp_leave_multicast_group(s->udp_fd, (struct sockaddr *)&s->dest_addr,(struct sockaddr *)&s->local_addr_storage);
closesocket(s->udp_fd);
#if HAVE_PTHREAD_CANCEL
if (s... | 445 |
FFmpeg | df884e038f5dc95f55ef07500b5b99b722835f8a | 1 | static int decode_pce(AVCodecContext *avctx, MPEG4AudioConfig *m4ac,
uint8_t (*layout_map)[3],
GetBitContext *gb, int byte_align_ref)
{
int num_front, num_side, num_back, num_lfe, num_assoc_data, num_cc;
int sampling_index;
int comment_len;
int tags;
... | 447 |
FFmpeg | 919f3554387e043bdfe10c6369356d1104882183 | 1 | void ff_decode_dxt1(const uint8_t *s, uint8_t *dst,
const unsigned int w, const unsigned int h,
const unsigned int stride) {
unsigned int bx, by, qstride = stride/4;
uint32_t *d = (uint32_t *) dst;
for (by=0; by < h/4; by++, d += stride-w)
for (bx=0; b... | 448 |
FFmpeg | 6a4d1c9063174234ca439244cf8f5f534afa1c28 | 0 | static const HWAccel *get_hwaccel(enum AVPixelFormat pix_fmt)
{
int i;
for (i = 0; hwaccels[i].name; i++)
if (hwaccels[i].pix_fmt == pix_fmt)
return &hwaccels[i];
return NULL;
}
| 450 |
qemu | 7157e2e23e89adcd436caeab31fdd6b47eded377 | 1 | static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val)
{
VirtIOPCIProxy *proxy = opaque;
VirtIODevice *vdev = proxy->vdev;
target_phys_addr_t pa;
switch (addr) {
case VIRTIO_PCI_GUEST_FEATURES:
/* Guest does not negotiate properly? We have to assume nothing. */
if (v... | 451 |
FFmpeg | 2d9821a2081aff5dca253386c6e7e71a04509cff | 0 | int ff_get_cpu_flags_x86(void)
{
int rval = 0;
#ifdef cpuid
int eax, ebx, ecx, edx;
int max_std_level, max_ext_level, std_caps = 0, ext_caps = 0;
int family = 0, model = 0;
union { int i[3]; char c[12]; } vendor;
if (!cpuid_test())
return 0; /* CPUID not supported */
... | 453 |
FFmpeg | 41bdd4adc4ab90a5ef7d63050a4046fcba711365 | 0 | static int read_sl_header(PESContext *pes, SLConfigDescr *sl, const uint8_t *buf, int buf_size)
{
GetBitContext gb;
int au_start_flag = 0, au_end_flag = 0, ocr_flag = 0, idle_flag = 0;
int padding_flag = 0, padding_bits = 0, inst_bitrate_flag = 0;
int dts_flag = -1, cts_flag = -1;
int64_t dts ... | 454 |
FFmpeg | b0cd14fb1dab4b044f7fe6b53ac635409849de77 | 0 | static enum AVHWDeviceType hw_device_match_type_in_name(const char *codec_name)
{
const char *type_name;
enum AVHWDeviceType type;
for (type = av_hwdevice_iterate_types(AV_HWDEVICE_TYPE_NONE);
type != AV_HWDEVICE_TYPE_NONE;
type = av_hwdevice_iterate_types(type)) {
type_name... | 455 |
FFmpeg | d6604b29ef544793479d7fb4e05ef6622bb3e534 | 0 | static av_cold int encode_close(AVCodecContext* avc_context)
{
TheoraContext *h = avc_context->priv_data;
th_encode_free(h->t_state);
av_freep(&h->stats);
av_freep(&avc_context->coded_frame);
av_freep(&avc_context->stats_out);
av_freep(&avc_context->extradata);
avc_context->extrada... | 456 |
FFmpeg | e72662e131e5099e34d5a7519c5690d2fff7b83f | 0 | static int vaapi_encode_h264_init_slice_params(AVCodecContext *avctx,
VAAPIEncodePicture *pic,
VAAPIEncodeSlice *slice)
{
VAAPIEncodeContext *ctx = avctx->priv_data;
VAEncSequenceParameterBufferH26... | 457 |
qemu | c963530a5b3e3e0f7304841adfe84416d82f59f6 | 0 | static char *assign_name(NetClientState *nc1, const char *model)
{
NetClientState *nc;
char buf[256];
int id = 0;
QTAILQ_FOREACH(nc, &net_clients, next) {
if (nc == nc1) {
continue;
}
/* For compatibility only bump id for net clients on a vlan */
i... | 458 |
qemu | 7860a380ac2a9fd09a6e8f31fd9db5318fc91285 | 0 | static void nbd_accept(void *opaque)
{
int server_fd = (uintptr_t) opaque;
struct sockaddr_in addr;
socklen_t addr_len = sizeof(addr);
int fd = accept(server_fd, (struct sockaddr *)&addr, &addr_len);
nbd_started = true;
if (fd >= 0 && nbd_client_new(exp, fd, nbd_client_closed)) {
... | 459 |
qemu | 5039d6e23586fe6bbedc5e4fe302b48a66890ade | 0 | static void dma_init2(struct dma_cont *d, int base, int dshift,
int page_base, int pageh_base,
qemu_irq *cpu_request_exit)
{
int i;
d->dshift = dshift;
d->cpu_request_exit = cpu_request_exit;
memory_region_init_io(&d->channel_io, NULL, &channel_io_o... | 460 |
qemu | 4c8ae0f60e63478aea0a1741cca95474b68fb949 | 0 | static inline bool migration_bitmap_test_and_reset_dirty(MemoryRegion *mr,
ram_addr_t offset)
{
bool ret;
int nr = (mr->ram_addr + offset) >> TARGET_PAGE_BITS;
ret = test_and_clear_bit(nr, migration_bitmap);
if (ret) {
migration... | 462 |
qemu | de9e9d9f17a36ff76c1a02a5348835e5e0a081b0 | 0 | static inline void gen_op_eval_bge(TCGv dst, TCGv_i32 src)
{
gen_mov_reg_V(cpu_tmp0, src);
gen_mov_reg_N(dst, src);
tcg_gen_xor_tl(dst, dst, cpu_tmp0);
tcg_gen_xori_tl(dst, dst, 0x1);
}
| 463 |
qemu | d85f4222b4681da7ebf8a90b26e085a68fa2c55a | 0 | static int qcow_set_key(BlockDriverState *bs, const char *key)
{
BDRVQcowState *s = bs->opaque;
uint8_t keybuf[16];
int len, i;
Error *err;
memset(keybuf, 0, 16);
len = strlen(key);
if (len > 16)
len = 16;
/* XXX: we could compress the chars to 7 bits to increase
... | 464 |
qemu | 0fada67420e29f389119ca6f44285203400e0730 | 0 | int vhost_dev_init(struct vhost_dev *hdev, int devfd, const char *devpath,
bool force)
{
uint64_t features;
int r;
if (devfd >= 0) {
hdev->control = devfd;
} else {
hdev->control = open(devpath, O_RDWR);
if (hdev->control < 0) {
return -er... | 465 |
qemu | cfaadf0e89e7c2a47462d5f96390c9a9b4de037c | 0 | static void fw_cfg_mem_realize(DeviceState *dev, Error **errp)
{
FWCfgMemState *s = FW_CFG_MEM(dev);
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
memory_region_init_io(&s->ctl_iomem, OBJECT(s), &fw_cfg_ctl_mem_ops,
FW_CFG(s), "fwcfg.ctl", FW_CFG_SIZE);
sysbus_init_mmio(sbd,... | 466 |
FFmpeg | 8b573ddda75980f724f779ff75aacc2ff81d9e0e | 0 | static void hls_prediction_unit(HEVCContext *s, int x0, int y0,
int nPbW, int nPbH,
int log2_cb_size, int partIdx)
{
#define POS(c_idx, x, y) \
&s->frame->data[c_idx][((y) >> s->sps->vsh... | 467 |
qemu | ad96090a01d848df67d70c5259ed8aa321fa8716 | 0 | static void select_soundhw (const char *optarg)
{
struct soundhw *c;
if (*optarg == '?') {
show_valid_cards:
printf ("Valid sound card names (comma separated):\n");
for (c = soundhw; c->name; ++c) {
printf ("%-11s %s\n", c->name, c->descr);
}
printf (... | 468 |
qemu | 4be746345f13e99e468c60acbd3a355e8183e3ce | 0 | void ide_bus_reset(IDEBus *bus)
{
bus->unit = 0;
bus->cmd = 0;
ide_reset(&bus->ifs[0]);
ide_reset(&bus->ifs[1]);
ide_clear_hob(bus);
/* pending async DMA */
if (bus->dma->aiocb) {
#ifdef DEBUG_AIO
printf("aio_cancel\n");
#endif
bdrv_aio_cancel(bus->dma->aiocb);
... | 469 |
qemu | 242acf3af4605adce933906bdc053b2414181ec7 | 0 | if_start(void)
{
struct mbuf *ifm, *ifqt;
DEBUG_CALL("if_start");
if (if_queued == 0)
return; /* Nothing to do */
again:
/* check if we can really output */
if (!slirp_can_output())
return;
/*
* See which queue to get next packet from
* If there's something i... | 470 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | MacIONVRAMState *macio_nvram_init (target_phys_addr_t size,
unsigned int it_shift)
{
MacIONVRAMState *s;
s = g_malloc0(sizeof(MacIONVRAMState));
s->data = g_malloc0(size);
s->size = size;
s->it_shift = it_shift;
memory_region_init_io(&s->mem, &macio... | 471 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void cmd646_data_write(void *opaque, target_phys_addr_t addr,
uint64_t data, unsigned size)
{
CMD646BAR *cmd646bar = opaque;
if (size == 1) {
ide_ioport_write(cmd646bar->bus, addr, data);
} else if (addr == 0) {
if (size == 2) {
ide_d... | 472 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static uint64_t kvm_apic_mem_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
return ~(uint64_t)0;
}
| 473 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static uint64_t bonito_cop_readl(void *opaque, target_phys_addr_t addr,
unsigned size)
{
uint32_t val;
PCIBonitoState *s = opaque;
val = ((uint32_t *)(&s->boncop))[addr/sizeof(uint32_t)];
return val;
}
| 475 |
qemu | 2278a69e7020d86a8c73a28474e7709d3e7d5081 | 0 | size_t iov_memset(const struct iovec *iov, const unsigned int iov_cnt,
size_t iov_off, int fillc, size_t size)
{
size_t iovec_off, buf_off;
unsigned int i;
iovec_off = 0;
buf_off = 0;
for (i = 0; i < iov_cnt && size; i++) {
if (iov_off < (iovec_off + iov[i].iov_len... | 476 |
qemu | 4ef130fca87b7a8c77e1af9ca967f28b683811d7 | 0 | static int img_open_password(BlockBackend *blk, const char *filename,
int flags, bool quiet)
{
BlockDriverState *bs;
char password[256];
bs = blk_bs(blk);
if (bdrv_is_encrypted(bs) && !(flags & BDRV_O_NO_IO)) {
qprintf(quiet, "Disk image '%s' is encrypted.\n... | 477 |
FFmpeg | c9b3c0c740ac912c835ccb7179afc2c5da8d5d23 | 0 | void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
{
const char *codec_name;
AVCodec *p;
char buf1[32];
int bitrate;
AVRational display_aspect_ratio;
if (encode)
p = avcodec_find_encoder(enc->codec_id);
else
p = avcodec_find_decoder(enc-... | 478 |
FFmpeg | 2c474ddbc5b90541ea4a65961490b6469d12529f | 0 | static int transcode_init(OutputFile *output_files,
int nb_output_files,
InputFile *input_files,
int nb_input_files)
{
int ret = 0, i, j;
AVFormatContext *os;
AVCodecContext *codec, *icodec;
OutputStream *ost;
Inp... | 479 |
FFmpeg | 229843aa359ae0c9519977d7fa952688db63f559 | 0 | static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt)
{
LavfiContext *lavfi = avctx->priv_data;
double min_pts = DBL_MAX;
int stream_idx, min_pts_sink_idx = 0;
AVFrame *frame = lavfi->decoded_frame;
AVPicture pict;
AVDictionary *frame_metadata;
int ret, i;
int size... | 480 |
qemu | 2f78e491d7b46542158ce0b8132ee4e05bc0ade4 | 1 | static void iothread_complete(UserCreatable *obj, Error **errp)
{
IOThread *iothread = IOTHREAD(obj);
iothread->stopping = false;
iothread->ctx = aio_context_new();
iothread->thread_id = -1;
qemu_mutex_init(&iothread->init_done_lock);
qemu_cond_init(&iothread->init_done_cond);
... | 481 |
qemu | 9b2fadda3e0196ffd485adde4fe9cdd6fae35300 | 1 | static void gen_tlbre_440(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;
}
switch (rB(ctx->opcode)) {
case 0:
case 1:
case ... | 482 |
qemu | 9ed5726c043958359b0f1fa44ab3e4f25f9d9a47 | 1 | target_ulong helper_evpe(target_ulong arg1)
{
// TODO
arg1 = 0;
// rt = arg1
return arg1;
}
| 483 |
qemu | 4e47e39ab0ded72c0af174131ecf49d588d66c12 | 1 | void helper_ldmxcsr(CPUX86State *env, uint32_t val)
{
env->mxcsr = val;
update_sse_status(env);
}
| 484 |
FFmpeg | 629750290f6122a72e68c34cf94f521a90def2ef | 1 | void ff_snow_horizontal_compose97i_mmx(IDWTELEM *b, int width){
const int w2= (width+1)>>1;
IDWTELEM temp[width >> 1];
const int w_l= (width>>1);
const int w_r= w2 - 1;
int i;
{ // Lift 0
IDWTELEM * const ref = b + w2 - 1;
i = 1;
b[0] = b[0] - ((W_DM * 2 * re... | 485 |
qemu | 731d5856cbb9c160fe02b90cd3cf354ea4f52f34 | 1 | static int net_dump_init(VLANState *vlan, const char *device,
const char *name, const char *filename, int len)
{
struct pcap_file_hdr hdr;
DumpState *s;
s = qemu_malloc(sizeof(DumpState));
s->fd = open(filename, O_CREAT | O_WRONLY | O_BINARY, 0644);
if (s->fd < 0)... | 486 |
FFmpeg | 70205f1799252c3363a5bb5ea7ea5df090f2c88f | 0 | void check_values (eq2_param_t *par)
{
/* yuck! floating point comparisons... */
if ((par->c == 1.0) && (par->b == 0.0) && (par->g == 1.0)) {
par->adjust = NULL;
}
#if HAVE_MMX && HAVE_6REGS
else if (par->g == 1.0 && ff_gCpuCaps.hasMMX) {
par->adjust = &affine_1d_MMX;
}
#endif
else {
... | 487 |
FFmpeg | dcfb0cad687ec89d3c7fe21a014c58f283050283 | 0 | static int ipvideo_decode_block_opcode_0x2(IpvideoContext *s)
{
unsigned char B;
int x, y;
/* copy block from 2 frames ago using a motion vector; need 1 more byte */
CHECK_STREAM_PTR(s->stream_ptr, s->stream_end, 1);
B = *s->stream_ptr++;
if (B < 56) {
x = 8 + (B % 7);
... | 488 |
FFmpeg | 9f8008a9815ed5ee8846de2bb97c980ddb7b2485 | 0 | static int input_get_buffer(AVCodecContext *codec, AVFrame *pic)
{
AVFilterContext *ctx = codec->opaque;
AVFilterBufferRef *ref;
int perms = AV_PERM_WRITE;
int i, w, h, stride[4];
unsigned edge;
if(av_image_check_size(w, h, 0, codec))
return -1;
if (codec->codec->capabi... | 489 |
qemu | 5f8b6491f20732e0a31e64bbf75b62def579e044 | 1 | static void coroutine_fn wait_for_overlapping_requests(BlockDriverState *bs,
int64_t sector_num, int nb_sectors)
{
BdrvTrackedRequest *req;
int64_t cluster_sector_num;
int cluster_nb_sectors;
bool retry;
/* If we touch the same cluster it counts as an overlap. This guarantees
* that al... | 492 |
qemu | e5d1fca0f20babbe355957b9ba536fe6187691cc | 1 | static NetSocketState *net_socket_fd_init_dgram(VLANState *vlan,
const char *model,
const char *name,
int fd, int is_connected)
{
struct sockaddr_in saddr;
int ne... | 493 |
qemu | f798184cfdcb7f92a38c5f717d675bd75e1fd3ac | 0 | int64_t bdrv_dirty_iter_next(BdrvDirtyBitmapIter *iter)
{
return hbitmap_iter_next(&iter->hbi);
}
| 494 |
qemu | ccf1d14a1e37abe1f0da162c00a8941963b47a4c | 0 | static void rtl8139_write_buffer(RTL8139State *s, const void *buf, int size)
{
if (s->RxBufAddr + size > s->RxBufferSize)
{
int wrapped = MOD2(s->RxBufAddr + size, s->RxBufferSize);
/* write packet data */
if (wrapped && s->RxBufferSize < 65536 && !rtl8139_RxWrap(s))
{
... | 495 |
qemu | 91cda45b69e45a089f9989979a65db3f710c9925 | 0 | int ppc_hash32_handle_mmu_fault(CPUPPCState *env, target_ulong address, int rw,
int mmu_idx)
{
struct mmu_ctx_hash32 ctx;
int access_type;
int ret = 0;
if (rw == 2) {
/* code access */
rw = 0;
access_type = ACCESS_CODE;
} else {
... | 496 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.