project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | 9f1963b3f72521f75a549f8afd61b19e7da63c6f | 0 | static int coroutine_fn blkreplay_co_discard(BlockDriverState *bs,
int64_t sector_num, int nb_sectors)
{
uint64_t reqid = request_id++;
int ret = bdrv_co_discard(bs->file->bs, sector_num, nb_sectors);
block_request_create(reqid, bs, qemu_coroutine_self());
qemu_coroutine_yield();
return... | 20,748 |
qemu | 149f54b53b7666a3facd45e86eece60ce7d3b114 | 0 | static inline uint32_t ldl_phys_internal(hwaddr addr,
enum device_endian endian)
{
uint8_t *ptr;
uint32_t val;
MemoryRegionSection *section;
section = phys_page_find(address_space_memory.dispatch, addr >> TARGET_PAGE_BITS);
if (!(memory_region_is_r... | 20,749 |
qemu | c5a93780453e6da919287c17e873c843544ef2a3 | 0 | int ne2000_can_receive(NetClientState *nc)
{
NE2000State *s = qemu_get_nic_opaque(nc);
if (s->cmd & E8390_STOP)
return 1;
return !ne2000_buffer_full(s);
}
| 20,750 |
FFmpeg | 6d702dc072ffc255cd0f709132e55661698313e7 | 0 | static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *pic, int *got_packet)
{
ProresContext *ctx = avctx->priv_data;
uint8_t *orig_buf, *buf, *slice_hdr, *slice_sizes, *tmp;
uint8_t *picture_size_pos;
PutBitContext pb;
int x, y, i, mb, q = 0;
... | 20,752 |
FFmpeg | 0d21a84605bad4e75dacb8196e5859902ed36f01 | 0 | static int epzs_motion_search4(MpegEncContext * s, int block,
int *mx_ptr, int *my_ptr,
int P[6][2], int pred_x, int pred_y,
int xmin, int ymin, int xmax, int ymax, uint8_t *ref_picture)
{
int best[2]={0, 0};
int d, dmi... | 20,753 |
FFmpeg | 378a5b9c5f1a8b51dee3b954713d18f330fbb027 | 0 | static int ffm_write_write_index(int fd, int64_t pos)
{
uint8_t buf[8];
int i;
for(i=0;i<8;i++)
buf[i] = (pos >> (56 - i * 8)) & 0xff;
lseek(fd, 8, SEEK_SET);
if (write(fd, buf, 8) != 8)
return AVERROR(EIO);
return 8;
}
| 20,754 |
FFmpeg | 294c05ce8a7fbe3de74023065c264c1d720ec3cd | 0 | static void rv34_output_i16x16(RV34DecContext *r, int8_t *intra_types, int cbp)
{
LOCAL_ALIGNED_16(DCTELEM, block16, [16]);
MpegEncContext *s = &r->s;
GetBitContext *gb = &s->gb;
int q_dc = rv34_qscale_tab[ r->luma_dc_quant_i[s->qscale] ],
q_ac = rv34_qscale_t... | 20,755 |
FFmpeg | 308e7484a3b1954072871a4090e5c672d1097fa5 | 0 | STATIC void DEF(put, pixels8_xy2)(uint8_t *block, const uint8_t *pixels,
ptrdiff_t line_size, int h)
{
MOVQ_ZERO(mm7);
SET_RND(mm6); // =2 for rnd and =1 for no_rnd version
__asm__ volatile(
"movq (%1), %%mm0 \n\t"
"movq 1(%1), %%mm4... | 20,756 |
FFmpeg | 33684b9c12b74c0140fb91e8150263db4a48d55e | 0 | static int atrac1_decode_frame(AVCodecContext *avctx, void *data,
int *data_size, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
AT1Ctx *q = avctx->priv_data;
int ch, ret, i;
GetBitContext gb;
float* samples ... | 20,757 |
qemu | 8d94c1ca53c638f6ec76840b0cb24677fb7705bf | 1 | static void virgl_cmd_submit_3d(VirtIOGPU *g,
struct virtio_gpu_ctrl_command *cmd)
{
struct virtio_gpu_cmd_submit cs;
void *buf;
size_t s;
VIRTIO_GPU_FILL_CMD(cs);
trace_virtio_gpu_cmd_ctx_submit(cs.hdr.ctx_id, cs.size);
buf = g_malloc(cs.size);
s... | 20,758 |
qemu | a1f0cce2ac0243572ff72aa561da67fe3766a395 | 1 | static int scsi_write_data(SCSIRequest *req)
{
SCSIDiskReq *r = DO_UPCAST(SCSIDiskReq, req, req);
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev);
uint32_t n;
/* No data transfer may already be in progress */
assert(r->req.aiocb == NULL);
n = r->iov.iov_len / 512;
i... | 20,759 |
qemu | 40a99aace3f9ffd65af07a89c381db3550b22316 | 1 | static int create_dynamic_disk(BlockBackend *blk, uint8_t *buf,
int64_t total_sectors)
{
VHDDynDiskHeader *dyndisk_header =
(VHDDynDiskHeader *) buf;
size_t block_size, num_bat_entries;
int i;
int ret;
int64_t offset = 0;
// Write the footer (twi... | 20,760 |
qemu | 9877860e7bd1e26ee70ab9bb5ebc34c92bf23bf5 | 1 | static int vmdk_is_cid_valid(BlockDriverState *bs)
{
BDRVVmdkState *s = bs->opaque;
uint32_t cur_pcid;
if (!s->cid_checked && bs->backing) {
BlockDriverState *p_bs = bs->backing->bs;
cur_pcid = vmdk_read_cid(p_bs, 0);
if (s->parent_cid != cur_pcid) {
/* CID no... | 20,762 |
FFmpeg | 6d93307f8df81808f0dcdbc064b848054a6e83b3 | 1 | static inline int mpeg2_decode_block_intra(MpegEncContext *s, int16_t *block, int n)
{
int level, dc, diff, i, j, run;
int component;
RLTable *rl;
uint8_t * const scantable = s->intra_scantable.permutated;
const uint16_t *quant_matrix;
const int qscale = s->qscale;
int mismatch;
... | 20,763 |
qemu | d9bce9d99f4656ae0b0127f7472db9067b8f84ab | 1 | PPC_OP(test_ctr_true)
{
T0 = (regs->ctr != 0 && (T0 & PARAM(1)) != 0);
RETURN();
}
| 20,764 |
FFmpeg | 53ea595eec984e3109310e8bb7ff4b5786d91057 | 1 | static inline int mov_stsc_index_valid(int index, int count)
{
return index + 1 < count;
}
| 20,765 |
qemu | f80872e21c07edd06eb343eeeefc8af404b518a6 | 1 | static void init_proc_POWER7 (CPUPPCState *env)
{
gen_spr_ne_601(env);
gen_spr_7xx(env);
/* Time base */
gen_tbl(env);
/* Processor identification */
spr_register(env, SPR_PIR, "PIR",
SPR_NOACCESS, SPR_NOACCESS,
&spr_read_generic, &spr_write_pir,
... | 20,767 |
qemu | 3a3b8502e6f0c8d30865c5f36d2c3ae4114000b5 | 1 | void spapr_events_init(sPAPREnvironment *spapr)
{
spapr->epow_irq = spapr_allocate_msi(0);
spapr->epow_notifier.notify = spapr_powerdown_req;
qemu_register_powerdown_notifier(&spapr->epow_notifier);
spapr_rtas_register("check-exception", check_exception);
}
| 20,768 |
qemu | 85d604af5f96c32734af9974ec6ddb625b6716a2 | 1 | target_ulong helper_add_suov(CPUTriCoreState *env, target_ulong r1,
target_ulong r2)
{
int64_t t1 = extract64(r1, 0, 32);
int64_t t2 = extract64(r2, 0, 32);
int64_t result = t1 + t2;
return suov32(env, result);
}
| 20,769 |
qemu | efec3dd631d94160288392721a5f9c39e50fb2bc | 1 | static void pcspk_class_initfn(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
dc->realize = pcspk_realizefn;
set_bit(DEVICE_CATEGORY_SOUND, dc->categories);
dc->no_user = 1;
dc->props = pcspk_properties;
}
| 20,770 |
FFmpeg | f929ab0569ff31ed5a59b0b0adb7ce09df3fca39 | 0 | static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
{
AVFrame *frame = data;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
ZmbvContext * const c = avctx->priv_data;
int zret = Z_OK; // Zlib return code
int len = buf_size;
int hi... | 20,771 |
FFmpeg | b87ca4bf25a3b5a0cac76fb8b3a7ab3bc0fd9882 | 0 | static int build_filter(ResampleContext *c, void *filter, double factor, int tap_count, int alloc, int phase_count, int scale,
int filter_type, double kaiser_beta){
int ph, i;
double x, y, w, t;
double *tab = av_malloc_array(tap_count+1, sizeof(*tab));
const int center= (ta... | 20,774 |
FFmpeg | 79997def65fd2313b48a5f3c3a884c6149ae9b5d | 0 | static void fft_test(AC3MDCTContext *mdct, AVLFG *lfg)
{
IComplex in[FN], in1[FN];
int k, n, i;
float sum_re, sum_im, a;
for (i = 0; i < FN; i++) {
in[i].re = av_lfg_get(lfg) % 65535 - 32767;
in[i].im = av_lfg_get(lfg) % 65535 - 32767;
in1[i] = in[i];
}
fft(... | 20,775 |
FFmpeg | b5bfb9f9de911846c43b52a7469b3cb413055492 | 0 | static void correlate_slice_buffered(SnowContext *s, slice_buffer * sb, SubBand *b, DWTELEM *src, int stride, int inverse, int use_median, int start_y, int end_y){
const int w= b->width;
int x,y;
// START_TIMER
DWTELEM * line;
DWTELEM * prev;
if (start_y != 0)
line = slice_bu... | 20,776 |
FFmpeg | fd88a257015f183f5ec3bff393a2f6cf7c117c02 | 0 | static void rv34_idct_add_c(uint8_t *dst, ptrdiff_t stride, DCTELEM *block){
int temp[16];
uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
int i;
rv34_row_transform(temp, block);
memset(block, 0, 16*sizeof(DCTELEM));
for(i = 0; i < 4; i++){
const int z0 = 13*(temp[4*0+i] + ... | 20,778 |
FFmpeg | b51e9354772de446e8196dabf9aad1567b22f74d | 1 | int ff_vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
{
int pqindex, lowquant, status;
if (v->finterpflag)
v->interpfrm = get_bits1(gb);
if (!v->s.avctx->codec)
return -1;
if (v->s.avctx->codec_id == AV_CODEC_ID_MSS2)
v->respic =
v->rangered =
... | 20,780 |
FFmpeg | b905ba5bc18c89c7fccd8621795755644442ef19 | 1 | static int mov_preroll_write_stbl_atoms(AVIOContext *pb, MOVTrack *track)
{
struct sgpd_entry {
int count;
int16_t roll_distance;
int group_description_index;
};
struct sgpd_entry *sgpd_entries = NULL;
int entries = -1;
int group = 0;
int i, j;
const in... | 20,781 |
FFmpeg | 2ffead98ddd384f61cdf6b1cb3f36592f54cd34a | 1 | static av_always_inline void emulated_edge_mc(uint8_t *buf, const uint8_t *src,
ptrdiff_t linesize_arg,
int block_w, int block_h,
int src_x, int src_y,
... | 20,782 |
qemu | 13c4941cdd8685d28c7e3a09e393a5579b58db46 | 1 | static int vmdk_init_tables(BlockDriverState *bs, VmdkExtent *extent,
Error **errp)
{
int ret;
int l1_size, i;
/* read the L1 table */
l1_size = extent->l1_size * sizeof(uint32_t);
extent->l1_table = g_try_malloc(l1_size);
if (l1_size && extent->l1_table == ... | 20,783 |
qemu | 788cf9f8c8cbda53843e060540f3e91a060eb744 | 1 | static void bdrv_password_cb(void *opaque, const char *password,
void *readline_opaque)
{
Monitor *mon = opaque;
BlockDriverState *bs = readline_opaque;
int ret = 0;
Error *local_err = NULL;
bdrv_add_key(bs, password, &local_err);
if (local_err) {
... | 20,784 |
qemu | b8852e87d9d113096342c3e0977266cda0fe9ee5 | 1 | static int vmdk_L2update(BlockDriverState *bs, VmdkMetaData *m_data)
{
BDRVVmdkState *s = bs->opaque;
/* update L2 table */
if (bdrv_pwrite(bs->file, ((int64_t)m_data->l2_offset * 512) + (m_data->l2_index * sizeof(m_data->offset)),
&(m_data->offset), sizeof(m_data->offset)) != siz... | 20,785 |
qemu | 7d5b5261104235cd6cc86930ab0d0a7372bfe04b | 1 | static int bdrv_inactivate_recurse(BlockDriverState *bs,
bool setting_flag)
{
BdrvChild *child, *parent;
int ret;
if (!setting_flag && bs->drv->bdrv_inactivate) {
ret = bs->drv->bdrv_inactivate(bs);
if (ret < 0) {
return ret;
... | 20,786 |
qemu | 5839e53bbc0fec56021d758aab7610df421ed8c8 | 1 | int qcow2_read_snapshots(BlockDriverState *bs)
{
BDRVQcowState *s = bs->opaque;
QCowSnapshotHeader h;
QCowSnapshotExtraData extra;
QCowSnapshot *sn;
int i, id_str_size, name_size;
int64_t offset;
uint32_t extra_data_size;
int ret;
if (!s->nb_snapshots) {
s->snaps... | 20,787 |
qemu | 213d3e9ea27f7fc55db7272c05255294b52ed3e4 | 0 | static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
{
struct flock fl;
struct target_flock *target_fl;
struct flock64 fl64;
struct target_flock64 *target_fl64;
#ifdef F_GETOWN_EX
struct f_owner_ex fox;
struct target_f_owner_ex *target_fox;
#endif
abi_long ret;
int host_cm... | 20,788 |
FFmpeg | 55db06af64d1acb7c3e304d61e7a1f265139d27a | 0 | const uint8_t *avpriv_find_start_code(const uint8_t *av_restrict p,
const uint8_t *end,
uint32_t *av_restrict state)
{
int i;
assert(p <= end);
if (p >= end)
return end;
for (i = 0; i < 3; i++) {
uin... | 20,789 |
qemu | a5b8dd2ce83208cd7d6eb4562339ecf5aae13574 | 0 | static int bdrv_open_common(BlockDriverState *bs, BdrvChild *file,
QDict *options, Error **errp)
{
int ret, open_flags;
const char *filename;
const char *driver_name = NULL;
const char *node_name = NULL;
QemuOpts *opts;
BlockDriver *drv;
Error *local_err ... | 20,790 |
qemu | b3db211f3c80bb996a704d665fe275619f728bd4 | 0 | static void test_visitor_out_enum_errors(TestOutputVisitorData *data,
const void *unused)
{
EnumOne i, bad_values[] = { ENUM_ONE__MAX, -1 };
Error *err;
for (i = 0; i < ARRAY_SIZE(bad_values) ; i++) {
err = NULL;
visit_type_EnumOne(data->ov, ... | 20,791 |
qemu | ddca7f86ac022289840e0200fd4050b2b58e9176 | 0 | static size_t v9fs_unpack(void *dst, struct iovec *out_sg, int out_num,
size_t offset, size_t size)
{
return v9fs_packunpack(dst, out_sg, out_num, offset, size, 0);
}
| 20,792 |
qemu | e11078846996ded6f824868ae63a0c77031ad64c | 0 | print_with_operands (const struct cris_opcode *opcodep,
unsigned int insn,
unsigned char *buffer,
bfd_vma addr,
disassemble_info *info,
/* If a prefix insn was before this insn (and is supposed
to be output as an address), here is a description of
it. */
const st... | 20,793 |
qemu | bd269ebc82fbaa5fe7ce5bc7c1770ac8acecd884 | 0 | static void socket_start_outgoing_migration(MigrationState *s,
SocketAddressLegacy *saddr,
Error **errp)
{
QIOChannelSocket *sioc = qio_channel_socket_new();
struct SocketConnectData *data = g_new0(struct SocketConnectD... | 20,794 |
qemu | 503006983a19be0b481946afac2cab0bdd21f124 | 0 | static void define_aarch64_debug_regs(ARMCPU *cpu)
{
/* Define breakpoint and watchpoint registers. These do nothing
* but read as written, for now.
*/
int i;
for (i = 0; i < 16; i++) {
ARMCPRegInfo dbgregs[] = {
{ .name = "DBGBVR", .state = ARM_CP_STATE_AA64,
... | 20,795 |
qemu | 80b8c0be748d2cf8a90955e409956cee1c932a38 | 0 | static void add_pc_test_case(const char *mname)
{
char *path;
PlugTestData *data;
if (!g_str_has_prefix(mname, "pc-")) {
return;
}
data = g_new(PlugTestData, 1);
data->machine = g_strdup(mname);
data->cpu_model = "Haswell"; /* 1.3+ theoretically */
data->sockets = 1;
... | 20,796 |
qemu | d0cc2fbfa607678866475383c508be84818ceb64 | 0 | void event_notifier_cleanup(EventNotifier *e)
{
close(e->fd);
}
| 20,798 |
qemu | a7812ae412311d7d47f8aa85656faadac9d64b56 | 0 | static void alpha_translate_init(void)
{
int i;
char *p;
static int done_init = 0;
if (done_init)
return;
cpu_env = tcg_global_reg_new(TCG_TYPE_PTR, TCG_AREG0, "env");
p = cpu_reg_names;
for (i = 0; i < 31; i++) {
sprintf(p, "ir%d", i);
cpu_ir[i] = tc... | 20,799 |
FFmpeg | 4a0f6651434c6f213d830140f575b4ec7858519f | 0 | static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame,
AVPacket *avpkt)
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
RawVideoContext *context = avctx->priv_data;
const uint8_t *buf = avpkt->data;
int buf_size ... | 20,800 |
qemu | bf0da4df83e8af7ec02e3809f3dd30cc0a42e4bc | 0 | static void *data_plane_thread(void *opaque)
{
VirtIOBlockDataPlane *s = opaque;
do {
aio_poll(s->ctx, true);
} while (!s->stopping || s->num_reqs > 0);
return NULL;
}
| 20,801 |
qemu | e01b444523e2b0c663b42b3e8f44ef48a6153051 | 0 | static int ppc_hash32_check_prot(int prot, int rwx)
{
int ret;
if (rwx == 2) {
if (prot & PAGE_EXEC) {
ret = 0;
} else {
ret = -2;
}
} else if (rwx) {
if (prot & PAGE_WRITE) {
ret = 0;
} else {
ret = -2;
... | 20,804 |
qemu | 316378e4d0214b45cfeaa01609aca4dabb18d78b | 0 | static void do_inject_mce(Monitor *mon, const QDict *qdict)
{
CPUState *cenv;
int cpu_index = qdict_get_int(qdict, "cpu_index");
int bank = qdict_get_int(qdict, "bank");
uint64_t status = qdict_get_int(qdict, "status");
uint64_t mcg_status = qdict_get_int(qdict, "mcg_status");
uint64_t ad... | 20,805 |
qemu | ad1be89948f88e89708b04ccd782456ccec3a6f0 | 0 | static void spice_register_types(void)
{
qemu_spice_init();
}
| 20,806 |
qemu | 4f5e19e6c570459cd524b29b24374f03860f5149 | 0 | static int pci_grackle_init_device(SysBusDevice *dev)
{
GrackleState *s;
int pci_mem_config, pci_mem_data;
s = FROM_SYSBUS(GrackleState, dev);
pci_mem_config = cpu_register_io_memory(pci_grackle_config_read,
pci_grackle_config_write, s);
pci_mem... | 20,807 |
qemu | 4baef2679e029c76707be1e2ed54bf3dd21693fe | 0 | int qemu_strtoul(const char *nptr, const char **endptr, int base,
unsigned long *result)
{
char *ep;
int err = 0;
if (!nptr) {
if (endptr) {
*endptr = nptr;
}
err = -EINVAL;
} else {
errno = 0;
*result = strtoul(nptr, &ep, ... | 20,808 |
qemu | 57407ea44cc0a3d630b9b89a2be011f1955ce5c1 | 0 | static void rtl8139_cleanup(NetClientState *nc)
{
RTL8139State *s = qemu_get_nic_opaque(nc);
s->nic = NULL;
}
| 20,809 |
qemu | 54f254f973a1b2ed0f3571390f4de060adfe23e8 | 0 | static int uhci_handle_td(UHCIState *s, UHCI_TD *td, uint32_t *int_mask,
int completion)
{
uint8_t pid;
int len = 0, max_len, err, ret = 0;
/* ??? This is wrong for async completion. */
if (td->ctrl & TD_CTRL_IOC) {
*int_mask |= 0x01;
}
if (!(td->c... | 20,810 |
qemu | 45a50b1668822c23afc2a89f724654e176518bc4 | 0 | static void option_rom_reset(void *_rrd)
{
RomResetData *rrd = _rrd;
cpu_physical_memory_write_rom(rrd->addr, rrd->data, rrd->size);
}
| 20,813 |
qemu | 364031f17932814484657e5551ba12957d993d7e | 0 | static int v9fs_synth_lremovexattr(FsContext *ctx,
V9fsPath *path, const char *name)
{
errno = ENOTSUP;
return -1;
}
| 20,814 |
qemu | 3ad493fc5ea38c005670adc5933058a28ccabdd4 | 0 | static inline int get_phys_addr(CPUState *env, uint32_t address,
int access_type, int is_user,
uint32_t *phys_ptr, int *prot,
target_ulong *page_size)
{
/* Fast Context Switch Extension. */
if (address < 0x020... | 20,815 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static uint64_t a9_scu_read(void *opaque, target_phys_addr_t offset,
unsigned size)
{
a9mp_priv_state *s = (a9mp_priv_state *)opaque;
switch (offset) {
case 0x00: /* Control */
return s->scu_control;
case 0x04: /* Configuration */
return (((1 << s->num... | 20,816 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | uint32_t ldl_phys(target_phys_addr_t addr)
{
return ldl_phys_internal(addr, DEVICE_NATIVE_ENDIAN);
}
| 20,817 |
qemu | 872dd82c83745a603d2e07a03d34313eb6467ae4 | 0 | void virtio_queue_set_host_notifier_fd_handler(VirtQueue *vq, bool assign,
bool set_handler)
{
if (assign && set_handler) {
event_notifier_set_handler(&vq->host_notifier, true,
virtio_queue_host_notifier_read);
} els... | 20,818 |
qemu | c2b38b277a7882a592f4f2ec955084b2b756daaa | 0 | bool qemu_clock_use_for_deadline(QEMUClockType type)
{
return !(use_icount && (type == QEMU_CLOCK_VIRTUAL));
}
| 20,819 |
qemu | 7e2515e87c41e2e658aaed466e11cbdf1ea8bcb1 | 0 | static void term_forward_char(void)
{
if (term_cmd_buf_index < term_cmd_buf_size) {
term_cmd_buf_index++;
}
}
| 20,820 |
qemu | 9f2130f58d5dd4e1fcb435cca08bf77e7c32e6c6 | 0 | static int input_initialise(struct XenDevice *xendev)
{
struct XenInput *in = container_of(xendev, struct XenInput, c.xendev);
int rc;
if (!in->c.con) {
xen_pv_printf(xendev, 1, "ds not set (yet)\n");
return -1;
}
rc = common_bind(&in->c);
if (rc != 0)
return rc;
... | 20,821 |
qemu | 1ea879e5580f63414693655fcf0328559cdce138 | 0 | int audio_pcm_sw_read (SWVoiceIn *sw, void *buf, int size)
{
HWVoiceIn *hw = sw->hw;
int samples, live, ret = 0, swlim, isamp, osamp, rpos, total = 0;
st_sample_t *src, *dst = sw->buf;
rpos = audio_pcm_sw_get_rpos_in (sw) % hw->samples;
live = hw->total_samples_captured - sw->total_hw_samp... | 20,822 |
qemu | c7b4b0b302709928b84582881a7b4fb6c1e39e2b | 0 | static void v9fs_wstat_post_chown(V9fsState *s, V9fsWstatState *vs, int err)
{
V9fsFidState *fidp;
if (err < 0) {
goto out;
}
if (vs->v9stat.name.size != 0) {
char *old_name, *new_name;
char *end;
old_name = vs->fidp->path.data;
end = strrchr(old_nam... | 20,824 |
FFmpeg | 7c1835c52a4be2e4e996f83c91a8d5a147b01100 | 0 | static int mpeg4video_probe(AVProbeData *probe_packet)
{
uint32_t temp_buffer= -1;
int VO=0, VOL=0, VOP = 0, VISO = 0, res=0;
int i;
for(i=0; i<probe_packet->buf_size; i++){
temp_buffer = (temp_buffer<<8) + probe_packet->buf[i];
if ((temp_buffer & 0xffffff00) != 0x100)
... | 20,825 |
qemu | a27365265cc2fed1178bf25a205e8ee02a9c0caf | 0 | static BlockDriverAIOCB *raw_aio_writev(BlockDriverState *bs,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque)
{
BDRVRawState *s = bs->opaque;
return paio_submit(bs, s->hfile, sector_num, qiov, nb_sector... | 20,827 |
qemu | a980a065fb5e86d6dec337e6cb6ff432f1a143c9 | 0 | static int usb_serial_handle_control(USBDevice *dev, int request, int value,
int index, int length, uint8_t *data)
{
USBSerialState *s = (USBSerialState *)dev;
int ret;
DPRINTF("got control %x, value %x\n",request, value);
ret = usb_desc_handle_control(dev, requ... | 20,828 |
qemu | fda4096fca83dcdc72e0fc0e4a1ae6e7724fb5e0 | 0 | static void test_acpi_piix4_tcg_cphp(void)
{
test_data data;
memset(&data, 0, sizeof(data));
data.machine = MACHINE_PC;
data.variant = ".cphp";
test_acpi_one("-smp 2,cores=3,sockets=2,maxcpus=6"
" -numa node -numa node",
&data);
free_test_data(&data... | 20,829 |
qemu | 621ff94d5074d88253a5818c6b9c4db718fbfc65 | 0 | static void ide_dev_set_bootindex(Object *obj, Visitor *v, const char *name,
void *opaque, Error **errp)
{
IDEDevice *d = IDE_DEVICE(obj);
int32_t boot_index;
Error *local_err = NULL;
visit_type_int32(v, name, &boot_index, &local_err);
if (local_err) {
... | 20,830 |
qemu | 51b19ebe4320f3dcd93cea71235c1219318ddfd2 | 0 | static void virtser_port_device_realize(DeviceState *dev, Error **errp)
{
VirtIOSerialPort *port = VIRTIO_SERIAL_PORT(dev);
VirtIOSerialPortClass *vsc = VIRTIO_SERIAL_PORT_GET_CLASS(port);
VirtIOSerialBus *bus = VIRTIO_SERIAL_BUS(qdev_get_parent_bus(dev));
int max_nr_ports;
bool plugging_port0... | 20,832 |
FFmpeg | a90de11dba816f57d01cf10b02eaaf90de24d5bb | 1 | void *av_malloc(unsigned int size)
{
void *ptr = NULL;
#if CONFIG_MEMALIGN_HACK
long diff;
#endif
/* let's disallow possible ambiguous cases */
if(size > (INT_MAX-16) )
return NULL;
#if CONFIG_MEMALIGN_HACK
ptr = malloc(size+16);
if(!ptr)
return ptr;
diff= ((... | 20,833 |
qemu | 4f4321c11ff6e98583846bfd6f0e81954924b003 | 1 | static int do_token_in(USBDevice *s, USBPacket *p)
{
int request, value, index;
int ret = 0;
if (p->devep != 0)
return s->info->handle_data(s, p);
request = (s->setup_buf[0] << 8) | s->setup_buf[1];
value = (s->setup_buf[3] << 8) | s->setup_buf[2];
index = (s->setup_buf[5... | 20,834 |
qemu | 1f51470d044852592922f91000e741c381582cdc | 1 | static int qemu_chr_open_socket(QemuOpts *opts, CharDriverState **_chr)
{
CharDriverState *chr = NULL;
TCPCharDriver *s = NULL;
int fd = -1;
int is_listen;
int is_waitconnect;
int do_nodelay;
int is_unix;
int is_telnet;
int ret;
is_listen = qemu_opt_get_bool(opt... | 20,836 |
qemu | 6ab3fc32ea640026726bc5f9f4db622d0954fb8a | 1 | static void imx_serial_write(void *opaque, hwaddr offset,
uint64_t value, unsigned size)
{
IMXSerialState *s = (IMXSerialState *)opaque;
unsigned char ch;
DPRINTF("write(offset=0x%" HWADDR_PRIx ", value = 0x%x) to %s\n",
offset, (unsigned int)value, s->chr ? ... | 20,837 |
qemu | 5f1399651eaab1b04e49107250d182968a227aa6 | 1 | static void numa_add(const char *optarg)
{
char option[128];
char *endptr;
unsigned long long value, endvalue;
unsigned long long nodenr;
value = endvalue = 0ULL;
optarg = get_opt_name(option, 128, optarg, ',');
if (*optarg == ',') {
optarg++;
}
if (!strcmp(opt... | 20,838 |
FFmpeg | 4641ae352ec587355764ffd5c43dd0d0ebd47654 | 1 | static int sap_read_header(AVFormatContext *s)
{
struct SAPState *sap = s->priv_data;
char host[1024], path[1024], url[1024];
uint8_t recvbuf[RTP_MAX_PACKET_LENGTH];
int port;
int ret, i;
AVInputFormat* infmt;
if (!ff_network_init())
return AVERROR(EIO);
av_url_spli... | 20,839 |
qemu | 53111180946a56d314a9c1d07d09b9ef91e847b9 | 1 | static void arm_gic_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass);
ARMGICClass *agc = ARM_GIC_CLASS(klass);
agc->parent_init = sbc->init;
sbc->init = arm_gic_init;
dc->no_user = 1;
}
| 20,841 |
FFmpeg | 8155233413540c63e53a620ff5734fb4b0635611 | 1 | static inline int l2_unscale_group(int steps, int mant, int scale_factor)
{
int shift, mod, val;
shift = scale_factor_modshift[scale_factor];
mod = shift & 3;
shift >>= 2;
/* XXX: store the result directly */
val = (2 * (mant - (steps >> 1))) * scale_factor_mult2[steps >> 2][mod];
... | 20,842 |
qemu | faadf50e2962dd54175647a80bd6fc4319c91973 | 1 | static void init_proc_970 (CPUPPCState *env)
{
gen_spr_ne_601(env);
gen_spr_7xx(env);
/* Time base */
gen_tbl(env);
/* Hardware implementation registers */
/* XXX : not implemented */
spr_register(env, SPR_HID0, "HID0",
SPR_NOACCESS, SPR_NOACCESS,
... | 20,843 |
FFmpeg | a9553bbb336a7186c62b3b14a0499c1b6ba61ebd | 1 | static int mov_write_header(AVFormatContext *s)
{
AVIOContext *pb = s->pb;
MOVMuxContext *mov = s->priv_data;
AVDictionaryEntry *t;
int i, hint_track = 0;
/* Default mode == MP4 */
mov->mode = MODE_MP4;
if (s->oformat != NULL) {
if (!strcmp("3gp", s->oformat->name)) mov-... | 20,844 |
FFmpeg | ce81e47c911fcff4f006b3b14b40a396eaa77696 | 1 | static void arith2_normalise(ArithCoder *c)
{
while ((c->high >> 15) - (c->low >> 15) < 2) {
if ((c->low ^ c->high) & 0x10000) {
c->high ^= 0x8000;
c->value ^= 0x8000;
c->low ^= 0x8000;
}
c->high = c->high << 8 & 0xFFFFFF | 0xFF;
c->v... | 20,845 |
qemu | db3a5ed7e4422491dac1f83264ebb01f6667ffc8 | 1 | static int usb_qdev_init(DeviceState *qdev, DeviceInfo *base)
{
USBDevice *dev = DO_UPCAST(USBDevice, qdev, qdev);
USBDeviceInfo *info = DO_UPCAST(USBDeviceInfo, qdev, base);
int rc;
pstrcpy(dev->product_desc, sizeof(dev->product_desc), info->product_desc);
dev->info = info;
dev->auto_a... | 20,846 |
FFmpeg | 71da0a5c9750e9fd0c9609470f610d32952923eb | 1 | void ff_eval_coefs(int *coefs, const int *refl)
{
int buffer[LPC_ORDER];
int *b1 = buffer;
int *b2 = coefs;
int i, j;
for (i=0; i < LPC_ORDER; i++) {
b1[i] = refl[i] * 16;
for (j=0; j < i; j++)
b1[j] = ((refl[i] * b2[i-j-1]) >> 12) + b2[j];
FFSWAP(... | 20,847 |
FFmpeg | b946bd8ef2c7aeee09469a4901182a44f9b67189 | 1 | static int decode_hq_slice(DiracContext *s, DiracSlice *slice, uint8_t *tmp_buf)
{
int i, level, orientation, quant_idx;
int qfactor[MAX_DWT_LEVELS][4], qoffset[MAX_DWT_LEVELS][4];
GetBitContext *gb = &slice->gb;
SliceCoeffs coeffs_num[MAX_DWT_LEVELS];
skip_bits_long(gb, 8*s->highquality.pre... | 20,848 |
FFmpeg | 49e5dcbce5f9e08ec375fd54c413148beb81f1d7 | 1 | static int ff_h261_resync(H261Context *h){
MpegEncContext * const s = &h->s;
int left, ret;
if(show_bits(&s->gb, 15)==0){
ret= h261_decode_gob_header(h);
if(ret>=0)
return 0;
}
//ok, its not where its supposed to be ...
s->gb= s->last_resync_gb;
align_... | 20,849 |
FFmpeg | 030c7f0309ec0e3cadb990408b4bb9b7fd739425 | 1 | static int epic_decode_tile(ePICContext *dc, uint8_t *out, int tile_height,
int tile_width, int stride)
{
int x, y;
uint32_t pix;
uint32_t *curr_row = NULL, *above_row = NULL, *above2_row;
for (y = 0; y < tile_height; y++, out += stride) {
above2_row = above_... | 20,850 |
FFmpeg | cf1e0786ed64e69614760bfb4ecd7adbde8e6094 | 0 | int ff_h264_context_init(H264Context *h)
{
ERContext *er = &h->er;
int mb_array_size = h->mb_height * h->mb_stride;
int y_size = (2 * h->mb_width + 1) * (2 * h->mb_height + 1);
int c_size = h->mb_stride * (h->mb_height + 1);
int yc_size = y_size + 2 * c_size;
int x, y, i;
FF_AL... | 20,851 |
FFmpeg | 6c4b87d3d6ae08a6da16b4616626b4d2a726afbf | 0 | static int thp_read_packet(AVFormatContext *s,
AVPacket *pkt)
{
ThpDemuxContext *thp = s->priv_data;
AVIOContext *pb = s->pb;
unsigned int size;
int ret;
if (thp->audiosize == 0) {
/* Terminate when last frame is reached. */
if (thp->frame >= t... | 20,852 |
FFmpeg | 0ea55365b91c250012ac8a80be5f0ebacd4fd55d | 0 | static int execute_code(AVCodecContext * avctx, int c)
{
AnsiContext *s = avctx->priv_data;
int ret, i, width, height;
switch(c) {
case 'A': //Cursor Up
s->y = FFMAX(s->y - (s->nb_args > 0 ? s->args[0]*s->font_height : s->font_height), 0);
break;
case 'B': //Cursor Down
... | 20,853 |
FFmpeg | e6c90ce94f1b07f50cea2babf7471af455cca0ff | 0 | void ff_h264_filter_mb(H264Context *h, H264SliceContext *sl,
int mb_x, int mb_y,
uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr,
unsigned int linesize, unsigned int uvlinesize)
{
const int mb_xy= mb_x + mb_y*h->mb_stride;
const int mb_... | 20,854 |
qemu | d4044c2a6b9ba4a00dd653f515a4b0ebfcb7e125 | 1 | e1000_set_link_status(VLANClientState *nc)
{
E1000State *s = DO_UPCAST(NICState, nc, nc)->opaque;
uint32_t old_status = s->mac_reg[STATUS];
if (nc->link_down)
s->mac_reg[STATUS] &= ~E1000_STATUS_LU;
else
s->mac_reg[STATUS] |= E1000_STATUS_LU;
if (s->mac_reg[STATUS] != old... | 20,855 |
qemu | f8ed85ac992c48814d916d5df4d44f9a971c5de4 | 1 | static void tcx_initfn(Object *obj)
{
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
TCXState *s = TCX(obj);
memory_region_init_ram(&s->rom, NULL, "tcx.prom", FCODE_MAX_ROM_SIZE,
&error_abort);
memory_region_set_readonly(&s->rom, true);
sysbus_init_mmio(sbd, &s->rom);
... | 20,857 |
FFmpeg | 60991ad6ae61e131085891c37e8e517b5014ce21 | 1 | static int alloc_buffer(AVCodecContext *s, InputStream *ist, FrameBuffer **pbuf)
{
FrameBuffer *buf = av_mallocz(sizeof(*buf));
int i, ret;
const int pixel_size = av_pix_fmt_descriptors[s->pix_fmt].comp[0].step_minus1+1;
int h_chroma_shift, v_chroma_shift;
int edge = 32; // XXX should be avco... | 20,858 |
qemu | d187e08dc4d0793dab1a9747b72b17a1cf0d3e43 | 1 | static void x86_cpu_initfn(Object *obj)
{
CPUState *cs = CPU(obj);
X86CPU *cpu = X86_CPU(obj);
X86CPUClass *xcc = X86_CPU_GET_CLASS(obj);
CPUX86State *env = &cpu->env;
FeatureWord w;
cs->env_ptr = env;
object_property_add(obj, "family", "int",
x86_cpuid_version_get_fa... | 20,859 |
FFmpeg | 68aefbe81cb3b9dd002108782bb8d798e1c12806 | 1 | static void video_refresh_timer(void *opaque)
{
VideoState *is = opaque;
VideoPicture *vp;
SubPicture *sp, *sp2;
if (is->video_st) {
if (is->pictq_size == 0) {
/* if no picture, need to wait */
schedule_refresh(is, 1);
} else {
/* dequeue... | 20,860 |
qemu | 4f4321c11ff6e98583846bfd6f0e81954924b003 | 1 | static int usb_net_handle_data(USBDevice *dev, USBPacket *p)
{
USBNetState *s = (USBNetState *) dev;
int ret = 0;
switch(p->pid) {
case USB_TOKEN_IN:
switch (p->devep) {
case 1:
ret = usb_net_handle_statusin(s, p);
break;
case 2:
... | 20,861 |
qemu | 6687b79d636cd60ed9adb1177d0d946b58fa7717 | 1 | int net_init_bridge(QemuOpts *opts, const char *name, VLANState *vlan)
{
TAPState *s;
int fd, vnet_hdr;
if (!qemu_opt_get(opts, "br")) {
qemu_opt_set(opts, "br", DEFAULT_BRIDGE_INTERFACE);
}
if (!qemu_opt_get(opts, "helper")) {
qemu_opt_set(opts, "helper", DEFAULT_BRIDGE_HE... | 20,862 |
qemu | 47985727e383eee191a39cc007541c17cd8680ee | 1 | static int vfio_setup_pcie_cap(VFIOPCIDevice *vdev, int pos, uint8_t size,
Error **errp)
{
uint16_t flags;
uint8_t type;
flags = pci_get_word(vdev->pdev.config + pos + PCI_CAP_FLAGS);
type = (flags & PCI_EXP_FLAGS_TYPE) >> 4;
if (type != PCI_EXP_TYPE_ENDPOINT &&
... | 20,863 |
FFmpeg | 1f6d0d42c53cde5e33e92c4529b774c256157f89 | 1 | static int nsv_read_close(AVFormatContext *s)
{
/* int i; */
NSVContext *nsv = s->priv_data;
av_freep(&nsv->nsvs_file_offset);
av_freep(&nsv->nsvs_timestamps);
#if 0
for(i=0;i<s->nb_streams;i++) {
AVStream *st = s->streams[i];
NSVStream *ast = st->priv_data;
... | 20,864 |
FFmpeg | 34c52005605d68f7cd1957b169b6732c7d2447d9 | 1 | static int create_vorbis_context(vorbis_enc_context *venc,
AVCodecContext *avctx)
{
vorbis_enc_floor *fc;
vorbis_enc_residue *rc;
vorbis_enc_mapping *mc;
int i, book, ret;
venc->channels = avctx->channels;
venc->sample_rate = avctx->sample_rate;
... | 20,865 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.