project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | 4be746345f13e99e468c60acbd3a355e8183e3ce | 0 | static uint16_t md_common_read(PCMCIACardState *card, uint32_t at)
{
MicroDriveState *s = MICRODRIVE(card);
IDEState *ifs;
uint16_t ret;
at -= s->io_base;
switch (s->opt & OPT_MODE) {
case OPT_MODE_MMAP:
if ((at & ~0x3ff) == 0x400) {
at = 0;
}
bre... | 10,084 |
qemu | a1cbfd554e11bb8af38c2f3e1f1574bf4c563cd2 | 0 | static void usb_msd_handle_data(USBDevice *dev, USBPacket *p)
{
MSDState *s = (MSDState *)dev;
uint32_t tag;
struct usb_msd_cbw cbw;
uint8_t devep = p->ep->nr;
switch (p->pid) {
case USB_TOKEN_OUT:
if (devep != 2)
goto fail;
switch (s->mode) {
c... | 10,085 |
qemu | a3251186fc6a04d421e9c4b65aa04ec32379ec38 | 0 | void optimize_flags_init(void)
{
cpu_env = tcg_global_reg_new_ptr(TCG_AREG0, "env");
cpu_cc_op = tcg_global_mem_new_i32(TCG_AREG0,
offsetof(CPUX86State, cc_op), "cc_op");
cpu_cc_src = tcg_global_mem_new(TCG_AREG0, offsetof(CPUX86State, cc_src),
... | 10,086 |
qemu | 6769da29c7a3caa9de4020db87f495de692cf8e2 | 0 | static size_t handle_aiocb_rw(struct qemu_paiocb *aiocb)
{
size_t nbytes;
char *buf;
if (!(aiocb->aio_type & QEMU_AIO_MISALIGNED)) {
/*
* If there is just a single buffer, and it is properly aligned
* we can just use plain pread/pwrite without any problems.
*/
... | 10,087 |
qemu | 85c97ca7a10b93216bc95052e9dabe3a4bb8736a | 0 | static int coroutine_fn bdrv_co_do_copy_on_readv(BlockDriverState *bs,
int64_t offset, unsigned int bytes, QEMUIOVector *qiov)
{
/* Perform I/O through a temporary buffer so that users who scribble over
* their read buffer while the operation is in progress do not end up
* modifying the image... | 10,088 |
qemu | b9f7855a50a7cbf04454fa84e9d1f333151f2259 | 0 | static int sector_limits_lun2qemu(int64_t sector, IscsiLun *iscsilun)
{
int limit = MIN(sector_lun2qemu(sector, iscsilun), INT_MAX / 2 + 1);
return limit < BDRV_REQUEST_MAX_SECTORS ? limit : 0;
}
| 10,089 |
qemu | 375092332eeaa6e47561ce47fd36144cdaf964d0 | 0 | static ssize_t test_block_init_func(QCryptoBlock *block,
size_t headerlen,
Error **errp,
void *opaque)
{
Buffer *header = opaque;
g_assert_cmpint(header->capacity, ==, 0);
buffer_reserve(he... | 10,090 |
qemu | bc0f0674f037a01f2ce0870ad6270a356a7a8347 | 0 | e1000_mmio_write(void *opaque, hwaddr addr, uint64_t val,
unsigned size)
{
E1000State *s = opaque;
unsigned int index = (addr & 0x1ffff) >> 2;
if (index < NWRITEOPS && macreg_writeops[index]) {
macreg_writeops[index](s, index, val);
} else if (index < NREADOPS && macreg... | 10,091 |
qemu | 245f7b51c0ea04fb2224b1127430a096c91aee70 | 0 | void vnc_hextile_set_pixel_conversion(VncState *vs, int generic)
{
if (!generic) {
switch (vs->ds->surface->pf.bits_per_pixel) {
case 8:
vs->send_hextile_tile = send_hextile_tile_8;
break;
case 16:
vs->send_hextile_tile = send_h... | 10,092 |
qemu | dfe80b071b6ef6c9c0b4e36191e2fe2d16050766 | 0 | static void qemu_rbd_aio_event_reader(void *opaque)
{
BDRVRBDState *s = opaque;
ssize_t ret;
do {
char *p = (char *)&s->event_rcb;
/* now read the rcb pointer that was sent from a non qemu thread */
if ((ret = read(s->fds[RBD_FD_READ], p + s->event_reader_pos,
... | 10,093 |
qemu | 80731d9da560461bbdcda5ad4b05f4a8a846fccd | 0 | static coroutine_fn int send_co_req(int sockfd, SheepdogReq *hdr, void *data,
unsigned int *wlen)
{
int ret;
ret = qemu_co_send(sockfd, hdr, sizeof(*hdr));
if (ret < sizeof(*hdr)) {
error_report("failed to send a req, %s", strerror(errno));
return... | 10,094 |
qemu | 3098dba01c7daab60762b6f6624ea88c0d6cb65a | 0 | static inline void start_exclusive(void)
{
CPUState *other;
pthread_mutex_lock(&exclusive_lock);
exclusive_idle();
pending_cpus = 1;
/* Make all other cpus stop executing. */
for (other = first_cpu; other; other = other->next_cpu) {
if (other->running) {
pending_c... | 10,095 |
FFmpeg | 6bed20f45a484f5709fec4c97a238240161b1797 | 0 | matroska_parse_cluster (MatroskaDemuxContext *matroska)
{
int res = 0;
uint32_t id;
uint64_t cluster_time = 0;
uint8_t *data;
int64_t pos;
int size;
av_log(matroska->ctx, AV_LOG_DEBUG,
"parsing cluster at %"PRId64"\n", url_ftell(&matroska->ctx->pb));
while (res =... | 10,096 |
qemu | 42a268c241183877192c376d03bd9b6d527407c7 | 0 | static inline void gen_evsel(DisasContext *ctx)
{
int l1 = gen_new_label();
int l2 = gen_new_label();
int l3 = gen_new_label();
int l4 = gen_new_label();
TCGv_i32 t0 = tcg_temp_local_new_i32();
tcg_gen_andi_i32(t0, cpu_crf[ctx->opcode & 0x07], 1 << 3);
tcg_gen_brcondi_i32(TCG_COND_EQ... | 10,097 |
qemu | ce5b1bbf624b977a55ff7f85bb3871682d03baff | 1 | static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
{
CPUState *cs = CPU(dev);
X86CPU *cpu = X86_CPU(dev);
X86CPUClass *xcc = X86_CPU_GET_CLASS(dev);
CPUX86State *env = &cpu->env;
Error *local_err = NULL;
static bool ht_warned;
if (xcc->kvm_required && !kvm_enabled()) {
... | 10,098 |
FFmpeg | e75bbcf493aeb549d04c56f49406aeee3950d93b | 1 | static int http_proxy_open(URLContext *h, const char *uri, int flags)
{
HTTPContext *s = h->priv_data;
char hostname[1024], hoststr[1024];
char auth[1024], pathbuf[1024], *path;
char line[1024], lower_url[100];
int port, ret = 0;
HTTPAuthType cur_auth_type;
char *authstr;
h->i... | 10,099 |
FFmpeg | 0e4b185a8df12c7b42642699a8df45e0de48de07 | 1 | void rtp_parse_close(RTPDemuxContext *s)
{
// TODO: fold this into the protocol specific data fields.
if (!strcmp(ff_rtp_enc_name(s->payload_type), "MP2T")) {
ff_mpegts_parse_close(s->ts);
}
av_free(s);
} | 10,100 |
qemu | fd97fd4408040a9a6dfaf2fdaeca1c566db6d0aa | 1 | static long gethugepagesize(const char *path, Error **errp)
{
struct statfs fs;
int ret;
do {
ret = statfs(path, &fs);
} while (ret != 0 && errno == EINTR);
if (ret != 0) {
error_setg_errno(errp, errno, "failed to get page size of file %s",
path)... | 10,101 |
qemu | ea53854a54bc54dddeec0c56572adf53384e960c | 1 | void qpci_device_foreach(QPCIBus *bus, int vendor_id, int device_id,
void (*func)(QPCIDevice *dev, int devfn, void *data),
void *data)
{
int slot;
for (slot = 0; slot < 32; slot++) {
int fn;
for (fn = 0; fn < 8; fn++) {
QP... | 10,102 |
FFmpeg | 8d8d2b73914a47cf9ce5ca4ff96de6fd067b84a6 | 1 | static int vc1_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
const uint8_t *buf, int buf_size)
{
VC1Context *v = avctx->priv_data;
MpegEncContext *s = &v->s;
AVFrame *pict = data;
uint8_t *buf2 = NULL;
/* no suppleme... | 10,103 |
qemu | 15d61692da651fc79b3fc40050b986c5a73055c0 | 1 | static int configuration_post_load(void *opaque, int version_id)
{
SaveState *state = opaque;
const char *current_name = MACHINE_GET_CLASS(current_machine)->name;
if (strncmp(state->name, current_name, state->len) != 0) {
error_report("Machine type received is '%s' and local is '%s'",
... | 10,105 |
qemu | 61b41b4c20eba08d2185297767e69153d7f3e09d | 1 | static inline void vmsvga_copy_rect(struct vmsvga_state_s *s,
int x0, int y0, int x1, int y1, int w, int h)
{
DisplaySurface *surface = qemu_console_surface(s->vga.con);
uint8_t *vram = s->vga.vram_ptr;
int bypl = surface_stride(surface);
int bypp = surface_bytes_per_pixel(surface)... | 10,106 |
FFmpeg | 32ac63ee10ca5daa149344a75d736c1b98177392 | 1 | static inline int decode_mb(MDECContext *a, DCTELEM block[6][64]){
int i;
const int block_index[6]= {5,4,0,1,2,3};
a->dsp.clear_blocks(block[0]);
for(i=0; i<6; i++){
if( mdec_decode_block_intra(a, block[ block_index[i] ], block_index[i]) < 0)
return -1;
}
return 0... | 10,107 |
qemu | 3e305e4a4752f70c0b5c3cf5b43ec957881714f7 | 1 | static int vnc_start_vencrypt_handshake(VncState *vs)
{
int ret;
if ((ret = gnutls_handshake(vs->tls.session)) < 0) {
if (!gnutls_error_is_fatal(ret)) {
VNC_DEBUG("Handshake interrupted (blocking)\n");
if (!gnutls_record_get_direction(vs->tls.session))
qemu_s... | 10,108 |
qemu | f897bf751fbd95e4015b95d202c706548586813a | 1 | static VirtIOBlockReq *virtio_blk_alloc_request(VirtIOBlock *s)
{
VirtIOBlockReq *req = g_slice_new(VirtIOBlockReq);
req->dev = s;
req->qiov.size = 0;
req->next = NULL;
req->elem = g_slice_new(VirtQueueElement);
return req;
}
| 10,109 |
FFmpeg | 5666b95c9f27efa6f9b1e1bb6c592b9a8d78bca5 | 1 | static int decompress_i(AVCodecContext *avctx, uint32_t *dst, int linesize)
{
SCPRContext *s = avctx->priv_data;
GetByteContext *gb = &s->gb;
int cx = 0, cx1 = 0, k = 0, clr = 0;
int run, r, g, b, off, y = 0, x = 0, z, ret;
unsigned backstep = linesize - avctx->width;
const int cxshift = ... | 10,111 |
FFmpeg | 4aca716a531b0bc1f05c96209cf30577d6e48baa | 1 | static int scale_vector(int16_t *vector, int length)
{
int bits, max = 0;
int64_t scale;
int i;
for (i = 0; i < length; i++)
max = FFMAX(max, FFABS(vector[i]));
max = FFMIN(max, 0x7FFF);
bits = normalize_bits(max, 15);
scale = (bits == 15) ? 0x7FFF : (1 << bits);
... | 10,112 |
FFmpeg | 7796f290653349a4126f2d448d11bb4440b9f257 | 1 | static int fileTest(uint8_t *ref[4], int refStride[4], int w, int h, FILE *fp,
enum AVPixelFormat srcFormat_in,
enum AVPixelFormat dstFormat_in)
{
char buf[256];
while (fgets(buf, sizeof(buf), fp)) {
struct Results r;
enum AVPixelFormat srcFormat;... | 10,113 |
FFmpeg | a4d18a3f54e5b0277234d8fcff65dff8516417a0 | 1 | static int lut2_config_output(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
LUT2Context *s = ctx->priv;
AVFilterLink *srcx = ctx->inputs[0];
AVFilterLink *srcy = ctx->inputs[1];
FFFrameSyncIn *in;
int ret;
if (srcx->format != srcy->format) {
av_log(ctx, AV_... | 10,114 |
qemu | d9bce9d99f4656ae0b0127f7472db9067b8f84ab | 1 | void do_subfe (void)
{
T0 = T1 + ~T0 + xer_ca;
if (likely(T0 >= T1 && (xer_ca == 0 || T0 != T1))) {
xer_ca = 0;
} else {
xer_ca = 1;
}
}
| 10,116 |
FFmpeg | b44985ba12d927d643a7bc03b0db98b83bf4fc9e | 0 | static inline void unpack_coeffs(SnowContext *s, SubBand *b, SubBand * parent, int orientation){
const int w= b->width;
const int h= b->height;
int x,y;
if(1){
int run;
x_and_coeff *xc= b->x_coeff;
x_and_coeff *prev_xc= NULL;
x_and_coeff *prev2_xc= xc;
... | 10,117 |
FFmpeg | eafbc6716cede6d4a652f8bedf82f2901c68d06d | 0 | static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
VmncContext * const c = avctx->priv_data;
GetByteContext *gb = &c->gb;
uint8_t *outptr;
int dx, dy, w,... | 10,118 |
FFmpeg | 25e4f8aaeee05a963146ebf8cd1d01817dba91d6 | 0 | void ff_fft_calc_sse(FFTContext *s, FFTComplex *z)
{
int ln = s->nbits;
long i, j;
long nblocks, nloops;
FFTComplex *p, *cptr;
asm volatile(
"movaps %0, %%xmm4 \n\t"
"movaps %1, %%xmm5 \n\t"
::"m"(*p1p1m1m1),
"m"(*(s->inverse ? p1p1m1p1 : p1p1p1m1))
... | 10,119 |
FFmpeg | 7888ae8266d8f721cc443fe3aa627d350ca01204 | 0 | static av_cold int cfhd_decode_init(AVCodecContext *avctx)
{
CFHDContext *s = avctx->priv_data;
avctx->bits_per_raw_sample = 10;
s->avctx = avctx;
avctx->width = 0;
avctx->height = 0;
return ff_cfhd_init_vlcs(s);
}
| 10,120 |
qemu | c5d7f60f0614250bd925071e25220ce5958f75d0 | 0 | static int dump_init(DumpState *s, int fd, bool paging, bool has_filter,
int64_t begin, int64_t length, Error **errp)
{
CPUState *cpu;
int nr_cpus;
Error *err = NULL;
int ret;
if (runstate_is_running()) {
vm_stop(RUN_STATE_SAVE_VM);
s->resume = true;
... | 10,121 |
qemu | a307d59434ba78b97544b42b8cfd24a1b62e39a6 | 0 | qemu_irq xics_assign_irq(struct icp_state *icp, int irq,
enum xics_irq_type type)
{
if ((irq < icp->ics->offset)
|| (irq >= (icp->ics->offset + icp->ics->nr_irqs))) {
return NULL;
}
assert((type == XICS_MSI) || (type == XICS_LSI));
icp->ics->irqs[irq ... | 10,122 |
qemu | 45a50b1668822c23afc2a89f724654e176518bc4 | 0 | int load_aout(const char *filename, target_phys_addr_t addr, int max_sz,
int bswap_needed, target_phys_addr_t target_page_size)
{
int fd, size, ret;
struct exec e;
uint32_t magic;
fd = open(filename, O_RDONLY | O_BINARY);
if (fd < 0)
return -1;
size = read(fd, ... | 10,123 |
qemu | f26ae302648d2977ba36d3dfcd0b70dce4e51060 | 0 | SH7750State *sh7750_init(CPUSH4State * cpu)
{
SH7750State *s;
int sh7750_io_memory;
int cpu_model = SH_CPU_SH7751R; /* for now */
s = qemu_mallocz(sizeof(SH7750State));
s->cpu = cpu;
s->periph_freq = 60000000; /* 60MHz */
sh7750_io_memory = cpu_register_io_memory(0,
sh7... | 10,125 |
qemu | dba433c03a0f5dc22a459435dd89557886298921 | 0 | static void *buffered_file_thread(void *opaque)
{
MigrationState *s = opaque;
int64_t initial_time = qemu_get_clock_ms(rt_clock);
int64_t sleep_time = 0;
int64_t max_size = 0;
bool last_round = false;
int ret;
qemu_mutex_lock_iothread();
DPRINTF("beginning savevm\n");
ret... | 10,126 |
qemu | bc7c08a2c375acb7ae4d433054415588b176d34c | 0 | static void test_qemu_strtoul_trailing(void)
{
const char *str = "123xxx";
char f = 'X';
const char *endptr = &f;
unsigned long res = 999;
int err;
err = qemu_strtoul(str, &endptr, 0, &res);
g_assert_cmpint(err, ==, 0);
g_assert_cmpint(res, ==, 123);
g_assert(endptr == ... | 10,127 |
FFmpeg | 0058584580b87feb47898e60e4b80c7f425882ad | 0 | static inline void downmix_3f_2r_to_stereo(float *samples)
{
int i;
for (i = 0; i < 256; i++) {
samples[i] += (samples[i + 256] + samples[i + 768]);
samples[i + 256] = (samples[i + 512] + samples[i + 1024]);
samples[i + 512] = samples[i + 768] = samples[i + 1024] = 0;
}
}
| 10,129 |
qemu | b436982f04fb33bb29fcdea190bd1fdc97dc65ef | 0 | static void mirror_write_complete(void *opaque, int ret)
{
MirrorOp *op = opaque;
MirrorBlockJob *s = op->s;
aio_context_acquire(blk_get_aio_context(s->common.blk));
if (ret < 0) {
BlockErrorAction action;
bdrv_set_dirty_bitmap(s->dirty_bitmap, op->sector_num, op->nb_sectors);... | 10,130 |
qemu | ea6c5f8ffe6de12e04e63acbb9937683b30216e2 | 0 | static void qemu_remap_bucket(MapCacheEntry *entry,
target_phys_addr_t size,
target_phys_addr_t address_index)
{
uint8_t *vaddr_base;
xen_pfn_t *pfns;
int *err;
unsigned int i, j;
target_phys_addr_t nb_pfn = size >> XC_PAGE_SHIFT;
... | 10,131 |
qemu | 1ad9f0a464fe78d30ee60b3629f7a825cf2fab13 | 0 | uint64_t kvmppc_hash64_read_pteg(PowerPCCPU *cpu, target_ulong pte_index)
{
int htab_fd;
struct kvm_get_htab_fd ghf;
struct kvm_get_htab_buf *hpte_buf;
ghf.flags = 0;
ghf.start_index = pte_index;
htab_fd = kvm_vm_ioctl(kvm_state, KVM_PPC_GET_HTAB_FD, &ghf);
if (htab_fd < 0) {
... | 10,132 |
qemu | 9f2130f58d5dd4e1fcb435cca08bf77e7c32e6c6 | 0 | static void xenfb_guest_copy(struct XenFB *xenfb, int x, int y, int w, int h)
{
DisplaySurface *surface = qemu_console_surface(xenfb->c.con);
int line, oops = 0;
int bpp = surface_bits_per_pixel(surface);
int linesize = surface_stride(surface);
uint8_t *data = surface_data(surface);
if ... | 10,134 |
qemu | 42a268c241183877192c376d03bd9b6d527407c7 | 0 | DISAS_INSN(fbcc)
{
uint32_t offset;
uint32_t addr;
TCGv flag;
int l1;
addr = s->pc;
offset = cpu_ldsw_code(env, s->pc);
s->pc += 2;
if (insn & (1 << 6)) {
offset = (offset << 16) | cpu_lduw_code(env, s->pc);
s->pc += 2;
}
l1 = gen_new_label();
... | 10,135 |
qemu | b854bc196f5c4b4e3299c0b0ee63cf828ece9e77 | 0 | int omap_validate_local_addr(struct omap_mpu_state_s *s,
target_phys_addr_t addr)
{
return addr >= OMAP_LOCALBUS_BASE && addr < OMAP_LOCALBUS_BASE + 0x1000000;
}
| 10,138 |
qemu | b23046abe78f48498a423b802d6d86ba0172d57f | 0 | static void build_pci_bus_state_init(AcpiBuildPciBusHotplugState *state,
AcpiBuildPciBusHotplugState *parent,
bool pcihp_bridge_en)
{
state->parent = parent;
state->device_table = build_alloc_array();
state->notify_table = build... | 10,139 |
FFmpeg | 1c7b71a5bdb88ebb69734100405bbb5441b871e8 | 0 | int ff_MPV_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *pic_arg, int *got_packet)
{
MpegEncContext *s = avctx->priv_data;
int i, stuffing_count, ret;
int context_count = s->slice_context_count;
s->picture_in_gop_number++;
if (load_input_pic... | 10,140 |
qemu | 6886b98036a8f8f5bce8b10756ce080084cef11b | 0 | void s390x_cpu_debug_excp_handler(CPUState *cs)
{
S390CPU *cpu = S390_CPU(cs);
CPUS390XState *env = &cpu->env;
CPUWatchpoint *wp_hit = cs->watchpoint_hit;
if (wp_hit && wp_hit->flags & BP_CPU) {
/* FIXME: When the storage-alteration-space control bit is set,
the exception sho... | 10,141 |
FFmpeg | 8baaa924bd42977c1f5c4aae0fe24985afb52a87 | 0 | static AVIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int depth, AVFormatContext *s)
{
AVIOContext *pb;
WtvFile *wf;
uint8_t *buffer;
if (seek_by_sector(s->pb, first_sector, 0) < 0)
return NULL;
wf = av_mallocz(sizeof(WtvFile));
if (!wf)
return ... | 10,142 |
FFmpeg | 87e8788680e16c51f6048af26f3f7830c35207a5 | 0 | static int smacker_probe(AVProbeData *p)
{
if (p->buf_size < 4)
return 0;
if(p->buf[0] == 'S' && p->buf[1] == 'M' && p->buf[2] == 'K'
&& (p->buf[3] == '2' || p->buf[3] == '4'))
return AVPROBE_SCORE_MAX;
else
return 0;
}
| 10,143 |
FFmpeg | f1e62af0e03f5d62e3f022031e0fca563fcc2c9d | 0 | int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque)
#endif
{
AVDictionary *options = NULL;
AVDictionaryEntry *e;
int ret=0;
if (args && *args) {
if (!filter->filter->priv_class) {
av_log(filter, AV_LOG_ERROR, "This filter does not take any "
... | 10,144 |
FFmpeg | 1c0e205fab4bd5bbfa0399af2cd5e281b414b3d5 | 1 | void audio_encode_example(const char *filename)
{
AVCodec *codec;
AVCodecContext *c= NULL;
int frame_size, i, j, out_size, outbuf_size;
FILE *f;
short *samples;
float t, tincr;
uint8_t *outbuf;
printf("Audio encoding\n");
/* find the MP2 encoder */
codec = avcodec_... | 10,145 |
FFmpeg | 3d232196372f309a75ed074c4cef30578eec1782 | 1 | static int w64_read_header(AVFormatContext *s)
{
int64_t size, data_ofs = 0;
AVIOContext *pb = s->pb;
WAVDemuxContext *wav = s->priv_data;
AVStream *st;
uint8_t guid[16];
int ret;
avio_read(pb, guid, 16);
if (memcmp(guid, ff_w64_guid_riff, 16))
/* riff + wave + fm... | 10,147 |
FFmpeg | 68e75e4dec6b5f46a190118eecbba1e95c396e3d | 0 | static void floor_fit(venc_context_t * venc, floor_t * fc, float * coeffs, int * posts, int samples) {
int range = 255 / fc->multiplier + 1;
int i;
for (i = 0; i < fc->values; i++) {
int position = fc->list[fc->list[i].sort].x;
int begin = fc->list[fc->list[FFMAX(i-1, 0)].sort].x;
... | 10,148 |
FFmpeg | 782e06e292c59abc8528484bd1cb253a42d7f53e | 0 | static int audio_decode_frame(VideoState *is)
{
AVPacket *pkt_temp = &is->audio_pkt_temp;
AVPacket *pkt = &is->audio_pkt;
AVCodecContext *dec = is->audio_st->codec;
int len1, data_size, resampled_data_size;
int64_t dec_channel_layout;
int got_frame;
av_unused double audio_clock0;
... | 10,150 |
qemu | cd6a9bb6e977864b1b7ec21b983fa0678b4b82e9 | 1 | static hwaddr ppc_hash64_pte_raddr(ppc_slb_t *slb, ppc_hash_pte64_t pte,
target_ulong eaddr)
{
hwaddr mask;
int target_page_bits;
hwaddr rpn = pte.pte1 & HPTE64_R_RPN;
/*
* We support 4K, 64K and 16M now
*/
target_page_bits = ppc_hash64_page_shif... | 10,151 |
qemu | 113fe792fd4931dd0538f03859278b8719ee4fa2 | 1 | static void nfs_file_close(BlockDriverState *bs)
{
NFSClient *client = bs->opaque;
nfs_client_close(client);
qemu_mutex_destroy(&client->mutex);
}
| 10,152 |
FFmpeg | b6267901c466c482b2f1af3578b0a6d88265d144 | 1 | static int mp3_seek(AVFormatContext *s, int stream_index, int64_t timestamp,
int flags)
{
MP3Context *mp3 = s->priv_data;
AVIndexEntry *ie;
AVStream *st = s->streams[0];
int64_t ret = av_index_search_timestamp(st, timestamp, flags);
uint32_t header = 0;
if (!mp3->x... | 10,153 |
qemu | b4ba67d9a702507793c2724e56f98e9b0f7be02b | 1 | static void test_bmdma_no_busmaster(void)
{
QPCIDevice *dev;
void *bmdma_base, *ide_base;
uint8_t status;
dev = get_pci_device(&bmdma_base, &ide_base);
/* No PRDT_EOT, each entry addr 0/size 64k, and in theory qemu shouldn't be
* able to access it anyway because the Bus Master bit in... | 10,154 |
FFmpeg | 58dee6e62d593747b5dbe8ce6c2ff1833151b9b0 | 1 | static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out)
{
char *pix_fmts;
OutputStream *ost = ofilter->ost;
AVCodecContext *codec = ost->st->codec;
AVFilterContext *last_filter = out->filter_ctx;
int pad_idx = out->pad_idx;
int ret;
char n... | 10,155 |
qemu | 9c4bbee9e3b83544257e82566342c29e15a88637 | 1 | static inline int handle_cpu_signal(uintptr_t pc, siginfo_t *info,
int is_write, sigset_t *old_set)
{
CPUState *cpu = current_cpu;
CPUClass *cc;
int ret;
unsigned long address = (unsigned long)info->si_addr;
/* We must handle PC addresses from two differe... | 10,156 |
FFmpeg | f6774f905fb3cfdc319523ac640be30b14c1bc55 | 1 | static void vc1_sprite_flush(AVCodecContext *avctx)
{
VC1Context *v = avctx->priv_data;
MpegEncContext *s = &v->s;
AVFrame *f = &s->current_picture.f;
int plane, i;
/* Windows Media Image codecs have a convergence interval of two keyframes.
Since we can't enforce it, clear to bla... | 10,157 |
qemu | 12d4536f7d911b6d87a766ad7300482ea663cea2 | 1 | void pause_all_vcpus(void)
{
}
| 10,158 |
FFmpeg | 9da369604ecf31d9dce2dee21ed214b8c43264c6 | 0 | static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
char *res, int res_len, int flags)
{
OverlayContext *over = ctx->priv;
int ret;
if (!strcmp(cmd, "x"))
ret = set_expr(&over->x_pexpr, args, ctx);
else if (!strcmp(cmd, "y"... | 10,160 |
FFmpeg | f65daf577af25df69f3b43a49879158d2f77f3f8 | 1 | static int rv20_decode_picture_header(RVDecContext *rv)
{
MpegEncContext *s = &rv->m;
int seq, mb_pos, i;
int rpr_bits;
#if 0
GetBitContext gb= s->gb;
for(i=0; i<64; i++){
av_log(s->avctx, AV_LOG_DEBUG, "%d", get_bits1(&gb));
if(i%4==3) av_log(s->avctx, AV_LOG_DEBUG, " ");... | 10,162 |
qemu | 294bbbb4252ab5ff42d0e2c09f209c0bd7eb9748 | 1 | void qio_channel_test_validate(QIOChannelTest *test)
{
g_assert_cmpint(memcmp(test->input,
test->output,
test->len), ==, 0);
g_assert(test->readerr == NULL);
g_assert(test->writeerr == NULL);
g_free(test->inputv);
g_free(test->outputv);... | 10,163 |
qemu | 18e5eec4db96a00907eb588a2b803401637c7f67 | 1 | static void vapic_map_rom_writable(VAPICROMState *s)
{
hwaddr rom_paddr = s->rom_state_paddr & ROM_BLOCK_MASK;
MemoryRegionSection section;
MemoryRegion *as;
size_t rom_size;
uint8_t *ram;
as = sysbus_address_space(&s->busdev);
if (s->rom_mapped_writable) {
memory_region... | 10,164 |
qemu | a2689242b10a7bbc9a952659a2a5cc04a86d10e1 | 1 | static int handle_intercept(S390CPU *cpu)
{
CPUState *cs = CPU(cpu);
struct kvm_run *run = cs->kvm_run;
int icpt_code = run->s390_sieic.icptcode;
int r = 0;
DPRINTF("intercept: 0x%x (at 0x%lx)\n", icpt_code,
(long)cs->kvm_run->psw_addr);
switch (icpt_code) {
case I... | 10,165 |
qemu | d70724cec84ff99ffc7f70dd567466acf228b389 | 1 | static void dump_op_count(void)
{
int i;
FILE *f;
f = fopen("/tmp/op.log", "w");
for(i = INDEX_op_end; i < NB_OPS; i++) {
fprintf(f, "%s %" PRId64 "\n", tcg_op_defs[i].name, tcg_table_op_count[i]);
}
fclose(f);
}
| 10,166 |
qemu | 19dfc44a94f759848a0f7de7378b2f8b9af6b5d0 | 1 | static void qed_check_for_leaks(QEDCheck *check)
{
BDRVQEDState *s = check->s;
size_t i;
for (i = s->header.header_size; i < check->nclusters; i++) {
if (!qed_test_bit(check->used_clusters, i)) {
check->result->leaks++;
}
}
}
| 10,167 |
qemu | d6f723b513a0c3c4e58343b7c52a2f9850861fa0 | 1 | static void test_qemu_strtol_full_max(void)
{
const char *str = g_strdup_printf("%ld", LONG_MAX);
long res;
int err;
err = qemu_strtol(str, NULL, 0, &res);
g_assert_cmpint(err, ==, 0);
g_assert_cmpint(res, ==, LONG_MAX);
}
| 10,168 |
qemu | e17a87792d4886d2a508672c1639df3c1d40f1d1 | 1 | char *spapr_get_cpu_core_type(const char *model)
{
char *core_type;
gchar **model_pieces = g_strsplit(model, ",", 2);
core_type = g_strdup_printf("%s-%s", model_pieces[0], TYPE_SPAPR_CPU_CORE);
g_strfreev(model_pieces);
/* Check whether it exists or whether we have to look up an alias name... | 10,169 |
qemu | db8a31d11d6a60f48d6817530640d75aa72a9a2f | 1 | static int get_refcount(BlockDriverState *bs, int64_t cluster_index)
{
BDRVQcowState *s = bs->opaque;
int refcount_table_index, block_index;
int64_t refcount_block_offset;
int ret;
uint16_t *refcount_block;
uint16_t refcount;
refcount_table_index = cluster_index >> (s->cluster_bits... | 10,170 |
qemu | af7e9e74c6a62a5bcd911726a9e88d28b61490e0 | 1 | static void openpic_irq_raise(OpenPICState *opp, int n_CPU, IRQ_src_t *src)
{
int n_ci = IDR_CI0_SHIFT - n_CPU;
if ((opp->flags & OPENPIC_FLAG_IDE_CRIT) && (src->ide & (1 << n_ci))) {
qemu_irq_raise(opp->dst[n_CPU].irqs[OPENPIC_OUTPUT_CINT]);
} else {
qemu_irq_raise(opp->dst[n_CPU].i... | 10,171 |
FFmpeg | 6e1a167c5564085385488b4f579e9efb987d4bfa | 1 | static int dx2_decode_slice_420(GetBitContext *gb, AVFrame *frame,
int line, int left,
uint8_t lru[3][8])
{
int x, y;
int width = frame->width;
int ystride = frame->linesize[0];
int ustride = frame->linesize[1];
int vstri... | 10,172 |
FFmpeg | 2da0d70d5eebe42f9fcd27ee554419ebe2a5da06 | 1 | static inline void RENAME(bgr16ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, int width)
{
int i;
assert(src1==src2);
for(i=0; i<width; i++)
{
int d0= ((uint32_t*)src1)[i];
int dl= (d0&0x07E0F81F);
int dh= ((d0>>5)&0x07C0F83F);
int dh2= (dh>>11) + (dh<<21);
int d= d... | 10,173 |
FFmpeg | d65b9114f35c1afe2a7061f0a1ec957d33ba02b5 | 0 | static int file_close_dir(URLContext *h)
{
#if HAVE_DIRENT_H
FileContext *c = h->priv_data;
closedir(c->dir);
return 0;
#else
return AVERROR(ENOSYS);
#endif /* HAVE_DIRENT_H */
}
| 10,174 |
FFmpeg | c89658008705d949c319df3fa6f400c481ad73e1 | 0 | static int sdp_read_header(AVFormatContext *s,
AVFormatParameters *ap)
{
RTSPState *rt = s->priv_data;
RTSPStream *rtsp_st;
int size, i, err;
char *content;
char url[1024];
/* read the whole sdp file */
/* XXX: better loading */
content = av_malloc(... | 10,176 |
FFmpeg | 1d16a1cf99488f16492b1bb48e023f4da8377e07 | 0 | static void ff_h264_idct_add16intra_mmx2(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]){
int i;
for(i=0; i<16; i++){
if(nnzc[ scan8[i] ]) ff_h264_idct_add_mmx (dst + block_offset[i], block + i*16, stride);
else if(block[i*16]) ff_h264_idct_dc_a... | 10,177 |
FFmpeg | 1ba08c94f5bb4d1c3c2d3651b5e01edb4ce172e2 | 1 | static void floor_encode(vorbis_enc_context *venc, vorbis_enc_floor *fc,
PutBitContext *pb, uint16_t *posts,
float *floor, int samples)
{
int range = 255 / fc->multiplier + 1;
int coded[MAX_FLOOR_VALUES]; // first 2 values are unused
int i, counter;
... | 10,178 |
qemu | fdd26fca3ce66863e547560fbde1a444fc5d71b7 | 1 | void qtest_quit(QTestState *s)
{
int status;
pid_t pid = qtest_qemu_pid(s);
if (pid != -1) {
kill(pid, SIGTERM);
waitpid(pid, &status, 0);
}
unlink(s->pid_file);
unlink(s->socket_path);
unlink(s->qmp_socket_path);
g_free(s->pid_file);
g_free(s->sock... | 10,179 |
FFmpeg | 20153fb8f6ce7f482298170d2700befe898fa1cd | 1 | static void guess_mv(MpegEncContext *s){
uint8_t fixed[s->mb_stride * s->mb_height];
#define MV_FROZEN 3
#define MV_CHANGED 2
#define MV_UNCHANGED 1
const int mb_stride = s->mb_stride;
const int mb_width = s->mb_width;
const int mb_height= s->mb_height;
int i, depth, num_avail;
int... | 10,181 |
qemu | 1b435b10324fe9937f254bb00718f78d5e50837a | 1 | void qemu_bh_delete(QEMUBH *bh)
{
qemu_bh_cancel(bh);
qemu_free(bh);
}
| 10,182 |
FFmpeg | 6c3d6a214c6a5b0a7e9c4aa1990d1c5b290806d5 | 1 | static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
{
ALSSpecificConfig *sconf = &ctx->sconf;
AVCodecContext *avctx = ctx->avctx;
GetBitContext *gb = &ctx->gb;
unsigned int k;
unsigned int s[8];
unsigned int sx[8];
unsigned int sub_blocks, log2_sub_blocks, ... | 10,183 |
qemu | ffa48cf5ab719e1e181e51b87bc0f5d397b791fa | 0 | void select_soundhw(const char *optarg)
{
}
| 10,184 |
qemu | 56c0269a9ec105d3848d9f900b5e38e6b35e2478 | 0 | static void cpu_exec_nocache(CPUState *cpu, int max_cycles,
TranslationBlock *orig_tb)
{
TranslationBlock *tb;
/* Should never happen.
We only end up here when an existing TB is too long. */
if (max_cycles > CF_COUNT_MASK)
max_cycles = CF_COUNT_MASK;
... | 10,185 |
qemu | ddb603ab6c981c1d67cb42266fc700c33e5b2d8f | 0 | static int xhci_submit(XHCIState *xhci, XHCITransfer *xfer, XHCIEPContext *epctx)
{
uint64_t mfindex;
DPRINTF("xhci_submit(slotid=%d,epid=%d)\n", xfer->slotid, xfer->epid);
xfer->in_xfer = epctx->type>>2;
switch(epctx->type) {
case ET_INTR_OUT:
case ET_INTR_IN:
xfer->pkts =... | 10,186 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void nvram_writel (void *opaque, target_phys_addr_t addr, uint32_t value)
{
M48t59State *NVRAM = opaque;
m48t59_write(NVRAM, addr, (value >> 24) & 0xff);
m48t59_write(NVRAM, addr + 1, (value >> 16) & 0xff);
m48t59_write(NVRAM, addr + 2, (value >> 8) & 0xff);
m48t59_write(NVRAM, addr +... | 10,188 |
qemu | 9445673ea67c272616b9f718396e267caa6446b7 | 0 | static QIOChannelSocket *nbd_establish_connection(SocketAddress *saddr,
Error **errp)
{
QIOChannelSocket *sioc;
Error *local_err = NULL;
sioc = qio_channel_socket_new();
qio_channel_set_name(QIO_CHANNEL(sioc), "nbd-client");
qio_channel_so... | 10,189 |
FFmpeg | 9f61abc8111c7c43f49ca012e957a108b9cc7610 | 0 | static int write_abst(AVFormatContext *s, OutputStream *os, int final)
{
HDSContext *c = s->priv_data;
AVIOContext *out;
char filename[1024], temp_filename[1024];
int i, ret;
int64_t asrt_pos, afrt_pos;
int start = 0, fragments;
int index = s->streams[os->first_stream]->id;
int6... | 10,191 |
qemu | 670e56d3ed2918b3861d9216f2c0540d9e9ae0d5 | 0 | static int mptsas_process_scsi_io_request(MPTSASState *s,
MPIMsgSCSIIORequest *scsi_io,
hwaddr addr)
{
MPTSASRequest *req;
MPIMsgSCSIIOReply reply;
SCSIDevice *sdev;
int status;
mptsas_fix_scsi_io_endiannes... | 10,195 |
qemu | 8417f904bad50021b432dfea12613345d9fb1f68 | 0 | bool s390_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
{
if (interrupt_request & CPU_INTERRUPT_HARD) {
S390CPU *cpu = S390_CPU(cs);
CPUS390XState *env = &cpu->env;
if (env->ex_value) {
/* Execution of the target insn is indivisible from
the pare... | 10,196 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | ioapic_mem_read(void *opaque, target_phys_addr_t addr, unsigned int size)
{
IOAPICCommonState *s = opaque;
int index;
uint32_t val = 0;
switch (addr & 0xff) {
case IOAPIC_IOREGSEL:
val = s->ioregsel;
break;
case IOAPIC_IOWIN:
if (size != 4) {
brea... | 10,197 |
qemu | fd56e0612b6454a282fa6a953fdb09281a98c589 | 0 | static void piix4_pm_machine_ready(Notifier *n, void *opaque)
{
PIIX4PMState *s = container_of(n, PIIX4PMState, machine_ready);
PCIDevice *d = PCI_DEVICE(s);
MemoryRegion *io_as = pci_address_space_io(d);
uint8_t *pci_conf;
pci_conf = d->config;
pci_conf[0x5f] = 0x10 |
(memory_... | 10,198 |
qemu | 1d4b638ad1fc273a19d93c7d4725fecdd7e5182a | 0 | static void vnc_dpy_resize(DisplayState *ds)
{
int size_changed;
VncDisplay *vd = ds->opaque;
VncState *vs;
/* server surface */
if (!vd->server)
vd->server = qemu_mallocz(sizeof(*vd->server));
if (vd->server->data)
qemu_free(vd->server->data);
*(vd->server) = *(d... | 10,199 |
qemu | 142e0950cfaf023a81112dc3cdfa799d769886a4 | 0 | bool hpet_find(void)
{
return object_resolve_path_type("", TYPE_HPET, NULL);
}
| 10,200 |
qemu | 30901475b91ef1f46304404ab4bfe89097f61b96 | 0 | static void gen_load_exclusive(DisasContext *s, int rt, int rt2,
TCGv_i32 addr, int size)
{
TCGv_i32 tmp = tcg_temp_new_i32();
s->is_ldex = true;
switch (size) {
case 0:
gen_aa32_ld8u(tmp, addr, get_mem_index(s));
break;
case 1:
ge... | 10,201 |
FFmpeg | d1adad3cca407f493c3637e20ecd4f7124e69212 | 0 | static inline void RENAME(bgr24ToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, long width, uint32_t *unused)
{
#if COMPILE_TEMPLATE_MMX
RENAME(bgr24ToUV_mmx)(dstU, dstV, src1, width, PIX_FMT_BGR24);
#else
int i;
for (i=0; i<width; i++) {
int b= src1[3*i + 0];
... | 10,202 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.