project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | 35337cc391245f251bfb9134f181c33e6375d6c1 | 0 | static bool get_phys_addr(CPUARMState *env, target_ulong address,
MMUAccessType access_type, ARMMMUIdx mmu_idx,
hwaddr *phys_ptr, MemTxAttrs *attrs, int *prot,
target_ulong *page_size, uint32_t *fsr,
ARMMMUFaultI... | 21,615 |
qemu | 61007b316cd71ee7333ff7a0a749a8949527575f | 0 | void bdrv_error_action(BlockDriverState *bs, BlockErrorAction action,
bool is_read, int error)
{
assert(error >= 0);
if (action == BLOCK_ERROR_ACTION_STOP) {
/* First set the iostatus, so that "info block" returns an iostatus
* that matches the events raised so fa... | 21,616 |
qemu | 4be746345f13e99e468c60acbd3a355e8183e3ce | 0 | static void ide_atapi_cmd_reply(IDEState *s, int size, int max_size)
{
if (size > max_size)
size = max_size;
s->lba = -1; /* no sector read */
s->packet_transfer_size = size;
s->io_buffer_size = size; /* dma: send the reply data as one chunk */
s->elementary_transfer_size = 0;
... | 21,617 |
FFmpeg | de4898a22909ff8a9ff846820627094bdd68b648 | 0 | static int stream_component_open(VideoState *is, int stream_index)
{
AVFormatContext *ic = is->ic;
AVCodecContext *enc;
AVCodec *codec;
SDL_AudioSpec wanted_spec, spec;
if (stream_index < 0 || stream_index >= ic->nb_streams)
return -1;
enc = ic->streams[stream_index]->codec;
... | 21,618 |
qemu | 35c2c8dc8c0899882a8e0d349d93bd657772f1e7 | 0 | void qemu_set_version(const char *version)
{
qemu_version = version;
}
| 21,620 |
qemu | dea8fde8b8cb1ab14e15308aadbf88eeccd4e873 | 0 | tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr)
{
tcg_target_ulong next_tb = 0;
tci_reg[TCG_AREG0] = (tcg_target_ulong)env;
assert(tb_ptr);
for (;;) {
#if defined(GETPC)
tci_tb_ptr = (uintptr_t)tb_ptr;
#endif
TCGOpcode opc = tb_ptr[0];
#if !defined(NDE... | 21,623 |
qemu | 7e2515e87c41e2e658aaed466e11cbdf1ea8bcb1 | 0 | static void do_commit(void)
{
int i;
for (i = 0; i < MAX_DISKS; i++) {
if (bs_table[i])
bdrv_commit(bs_table[i]);
}
}
| 21,624 |
qemu | 1c29331248d82e5a9caaf7974756a9d8bd5cd1e5 | 0 | static int v9fs_do_mknod(V9fsState *s, V9fsString *path, mode_t mode, dev_t dev)
{
return s->ops->mknod(&s->ctx, path->data, mode, dev);
}
| 21,625 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static uint64_t g364fb_ctrl_read(void *opaque,
target_phys_addr_t addr,
unsigned int size)
{
G364State *s = opaque;
uint32_t val;
if (addr >= REG_CURS_PAT && addr < REG_CURS_PAT + 0x1000) {
/* cursor pattern */
int i... | 21,626 |
qemu | 8e9b0d24fb986d4241ae3b77752eca5dab4cb486 | 0 | static void vncws_send_handshake_response(VncState *vs, const char* key)
{
char combined_key[WS_CLIENT_KEY_LEN + WS_GUID_LEN + 1];
unsigned char hash[SHA1_DIGEST_LEN];
size_t hash_size = sizeof(hash);
char *accept = NULL, *response = NULL;
gnutls_datum_t in;
int ret;
g_strlcpy(comb... | 21,628 |
FFmpeg | a878dfa4f57d068eb69fb6614f7a4a20f769ee7b | 0 | av_cold int ff_ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
{
int j;
fs->plane_count = f->plane_count;
fs->transparency = f->transparency;
for (j = 0; j < f->plane_count; j++) {
PlaneContext *const p = &fs->plane[j];
if (fs->ac) {
if (!p->state)
... | 21,629 |
qemu | 4207117c93357347500235952ce7891688089cb1 | 0 | static void spitz_init(int ram_size, int vga_ram_size, int boot_device,
DisplayState *ds, const char **fd_filename, int snapshot,
const char *kernel_filename, const char *kernel_cmdline,
const char *initrd_filename, const char *cpu_model)
{
spitz_common_init(ram_... | 21,630 |
FFmpeg | 8aba7968dd604aae91ee42cbce0be3dad7dceb30 | 1 | static int vcr1_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
VCR1Context *const a = avctx->priv_data;
AVFrame *const p = data;
const uint... | 21,631 |
qemu | 148dfc2a8be0b237ef80b4d421f549464aa6a3d0 | 1 | long disas_insn(DisasContext *s, uint8_t *pc_start)
{
int b, prefixes, aflag, dflag;
int shift, ot;
int modrm, reg, rm, mod, reg_addr, op, opreg, offset_addr, val;
unsigned int next_eip;
s->pc = pc_start;
prefixes = 0;
aflag = s->code32;
dflag = s->code32;
s->override = -... | 21,632 |
qemu | f89b60f6e5fee3923bedf80e82b4e5efc1bb156b | 1 | static void xhci_process_commands(XHCIState *xhci)
{
XHCITRB trb;
TRBType type;
XHCIEvent event = {ER_COMMAND_COMPLETE, CC_SUCCESS};
dma_addr_t addr;
unsigned int i, slotid = 0;
DPRINTF("xhci_process_commands()\n");
if (!xhci_running(xhci)) {
DPRINTF("xhci_process_commands... | 21,634 |
qemu | a9175169cc55ecff23a158dfee7d9cbb0b75d185 | 1 | void cpu_loop(CPUTLGState *env)
{
CPUState *cs = CPU(tilegx_env_get_cpu(env));
int trapnr;
while (1) {
cpu_exec_start(cs);
trapnr = cpu_tilegx_exec(cs);
cpu_exec_end(cs);
switch (trapnr) {
case TILEGX_EXCP_SYSCALL:
env->regs[TILEGX_R_RE] = do_s... | 21,635 |
qemu | 7d8246960e03dabf37726c01d231e89dfde9b229 | 1 | sofree(struct socket *so)
{
Slirp *slirp = so->slirp;
struct mbuf *ifm;
for (ifm = (struct mbuf *) slirp->if_fastq.qh_link;
(struct quehead *) ifm != &slirp->if_fastq;
ifm = ifm->ifq_next) {
if (ifm->ifq_so == so) {
ifm->ifq_so = NULL;
for (ifm = (struct mbuf *) slirp->if_... | 21,636 |
FFmpeg | f9d7e9feec2a0fd7f7930d01876a70a9b8a4a3b9 | 1 | static void close_slave(TeeSlave *tee_slave)
{
AVFormatContext *avf;
unsigned i;
avf = tee_slave->avf;
for (i = 0; i < avf->nb_streams; ++i) {
AVBitStreamFilterContext *bsf_next, *bsf = tee_slave->bsfs[i];
while (bsf) {
bsf_next = bsf->next;
av_bitstrea... | 21,637 |
FFmpeg | 7aabeea9ba0e557e834c886de5ea4db8e9a5193d | 1 | static int ac3_decode_frame(AVCodecContext * avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
AC3DecodeContext *s = avctx->priv_data;
int blk, ch, err, ret;
const uint8_t *channel_map;
cons... | 21,638 |
FFmpeg | 2121e3e1306181acc39316639bb731919af5bab7 | 0 | static int ffserver_parse_config_global(FFServerConfig *config, const char *cmd,
const char **p, int line_num)
{
int val;
char arg[1024];
if (!av_strcasecmp(cmd, "Port") || !av_strcasecmp(cmd, "HTTPPort")) {
if (!av_strcasecmp(cmd, "Port"))
... | 21,639 |
FFmpeg | a553c6a347d3d28d7ee44c3df3d5c4ee780dba23 | 0 | int ff_h264_fill_default_ref_list(H264Context *h)
{
int i, len;
if (h->slice_type_nos == AV_PICTURE_TYPE_B) {
Picture *sorted[32];
int cur_poc, list;
int lens[2];
if (FIELD_PICTURE(h))
cur_poc = h->cur_pic_ptr->field_poc[h->picture_structure == PICT_BOTTOM... | 21,640 |
qemu | 4295f879becfbbb9f4330489311586b96915d920 | 1 | static int check_strtox_error(const char *p, char *endptr, const char **next,
int err)
{
/* If no conversion was performed, prefer BSD behavior over glibc
* behavior.
*/
if (err == 0 && endptr == p) {
err = EINVAL;
}
if (!next && *endptr) {
... | 21,642 |
qemu | 94fb0909645de18481cc726ee0ec9b5afa861394 | 1 | static void ram_decompress_close(RamDecompressState *s)
{
inflateEnd(&s->zstream);
}
| 21,643 |
qemu | 9a75b0a037e3a8030992244353f17b62f6daf2ab | 1 | static void ahci_hba_enable(AHCIQState *ahci)
{
/* Bits of interest in this section:
* GHC.AE Global Host Control / AHCI Enable
* PxCMD.ST Port Command: Start
* PxCMD.SUD "Spin Up Device"
* PxCMD.POD "Power On Device"
* PxCMD.FRE "FIS Receive Enable"
* PxCMD.FR "FIS ... | 21,644 |
FFmpeg | aed128f07d142a7afc51f1f0c572a31b3b9bc2a6 | 1 | static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length)
{
int x, y;
const int width = f->avctx->width;
const int height = f->avctx->height;
uint16_t *src = (uint16_t *)f->last_picture.data[0];
uint16_t *dst = (uint16_t *)f->current_picture.data[0];
const int stri... | 21,645 |
qemu | 243a273ee0168fc373f342479ae92fe3028b45c1 | 1 | void *kqemu_vmalloc(size_t size)
{
static int phys_ram_fd = -1;
static int phys_ram_size = 0;
const char *tmpdir;
char phys_ram_file[1024];
void *ptr;
struct statfs stfs;
if (phys_ram_fd < 0) {
tmpdir = getenv("QEMU_TMPDIR");
if (!tmpdir)
tmpdir = "/d... | 21,646 |
qemu | b4ba67d9a702507793c2724e56f98e9b0f7be02b | 1 | static uint64_t qvirtio_pci_config_readq(QVirtioDevice *d, uint64_t off)
{
QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d;
uint64_t val;
val = qpci_io_readq(dev->pdev, CONFIG_BASE(dev) + off);
if (qvirtio_is_big_endian(d)) {
val = bswap64(val);
}
return val;
}
| 21,647 |
FFmpeg | 1c0e205fab4bd5bbfa0399af2cd5e281b414b3d5 | 1 | void video_decode_example(const char *outfilename, const char *filename)
{
AVCodec *codec;
AVCodecContext *c= NULL;
int frame, size, got_picture, len;
FILE *f;
AVFrame *picture;
uint8_t inbuf[INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE], *inbuf_ptr;
char buf[1024];
/* set end of... | 21,648 |
qemu | 7453c96b78c2b09aa72924f933bb9616e5474194 | 1 | static int rebuild_refcount_structure(BlockDriverState *bs,
BdrvCheckResult *res,
uint16_t **refcount_table,
int64_t *nb_clusters)
{
BDRVQcowState *s = bs->opaque;
int64_t first_free_cluster =... | 21,649 |
FFmpeg | ac4b32df71bd932838043a4838b86d11e169707f | 1 | static void vp8_idct_dc_add4uv_c(uint8_t *dst, int16_t block[4][16],
ptrdiff_t stride)
{
vp8_idct_dc_add_c(dst + stride * 0 + 0, block[0], stride);
vp8_idct_dc_add_c(dst + stride * 0 + 4, block[1], stride);
vp8_idct_dc_add_c(dst + stride * 4 + 0, block[2], stride);
... | 21,650 |
qemu | e4f4fb1eca795e36f363b4647724221e774523c1 | 1 | static void fw_cfg_mem_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
dc->realize = fw_cfg_mem_realize;
dc->props = fw_cfg_mem_properties;
} | 21,651 |
qemu | 64c7c1175b4e3e6fe005934cde63259d8adad392 | 1 | int xen_pt_msix_init(XenPCIPassthroughState *s, uint32_t base)
{
uint8_t id = 0;
uint16_t control = 0;
uint32_t table_off = 0;
int i, total_entries, bar_index;
XenHostPCIDevice *hd = &s->real_device;
PCIDevice *d = &s->dev;
int fd = -1;
XenPTMSIX *msix = NULL;
int rc = 0;
... | 21,652 |
qemu | 5839e53bbc0fec56021d758aab7610df421ed8c8 | 1 | static int64_t archipelago_volume_info(BDRVArchipelagoState *s)
{
uint64_t size;
int ret, targetlen;
struct xseg_request *req;
struct xseg_reply_info *xinfo;
AIORequestData *reqdata = g_malloc(sizeof(AIORequestData));
const char *volname = s->volname;
targetlen = strlen(volname);
... | 21,653 |
qemu | 4c4f0e4801ac79632d03867c88aafc90b4ce503c | 1 | static void openpic_set_irq(void *opaque, int n_IRQ, int level)
{
OpenPICState *opp = opaque;
IRQSource *src;
src = &opp->src[n_IRQ];
DPRINTF("openpic: set irq %d = %d ipvp=%08x\n",
n_IRQ, level, src->ipvp);
if (src->ipvp & IPVP_SENSE_MASK) {
/* level-sensitive irq */
... | 21,654 |
FFmpeg | 220b24c7c97dc033ceab1510549f66d0e7b52ef1 | 1 | static int libschroedinger_decode_frame(AVCodecContext *avctx,
void *data, int *got_frame,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
int64_t pts = avpkt->pts;
SchroTag *tag;
... | 21,655 |
qemu | 372579427a5040a26dfee78464b50e2bdf27ef26 | 1 | static void qemu_tcg_wait_io_event(CPUState *cpu)
{
while (all_cpu_threads_idle()) {
stop_tcg_kick_timer();
qemu_cond_wait(cpu->halt_cond, &qemu_global_mutex);
}
start_tcg_kick_timer();
CPU_FOREACH(cpu) {
qemu_wait_io_event_common(cpu);
}
}
| 21,656 |
qemu | 15fa08f8451babc88d733bd411d4c94976f9d0f8 | 1 | TCGOp *tcg_op_insert_after(TCGContext *s, TCGOp *old_op,
TCGOpcode opc, int nargs)
{
int oi = s->gen_next_op_idx;
int prev = old_op - s->gen_op_buf;
int next = old_op->next;
TCGOp *new_op;
tcg_debug_assert(oi < OPC_BUF_SIZE);
s->gen_next_op_idx = oi + 1;
... | 21,657 |
qemu | 12ca76fc48081b3a0ad1a70546abfcf198aedfc4 | 1 | static inline bool check_lba_range(SCSIDiskState *s,
uint64_t sector_num, uint32_t nb_sectors)
{
/*
* The first line tests that no overflow happens when computing the last
* sector. The second line tests that the last accessed sector is in
* range.
*/
... | 21,658 |
FFmpeg | a6a2282c25abe43e352010a7c3fbc92994c0bc1c | 0 | static av_cold int rv30_decode_init(AVCodecContext *avctx)
{
RV34DecContext *r = avctx->priv_data;
int ret;
r->rv30 = 1;
if ((ret = ff_rv34_decode_init(avctx)) < 0)
return ret;
if(avctx->extradata_size < 2){
av_log(avctx, AV_LOG_ERROR, "Extradata is too small.\n");
... | 21,659 |
FFmpeg | b75c0a72ed3bb5fab0a0b66ede94f6de887db585 | 0 | static int jpeg2000_decode_packets_po_iteration(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
int RSpoc, int CSpoc,
int LYEpoc, int REpoc, int CEpoc,
int Ppoc)
{
int ret = 0;
... | 21,660 |
FFmpeg | c2409a7c5b1c1f43ee8b00c13ed41edc0321db0b | 0 | static av_cold int vmdaudio_decode_init(AVCodecContext *avctx)
{
VmdAudioContext *s = avctx->priv_data;
if (avctx->channels < 1 || avctx->channels > 2) {
av_log(avctx, AV_LOG_ERROR, "invalid number of channels\n");
return AVERROR(EINVAL);
}
if (avctx->block_align < 1) {
... | 21,661 |
FFmpeg | 37138338ff602803d174b13fecd363a083bc2f9a | 0 | static int sunrast_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
const uint8_t *buf_end = avpkt->data + avpkt->size;
AVFrame * const p = data;
unsigned int w, h, depth, type, mapty... | 21,662 |
FFmpeg | 0872bb23b4bd2d94a8ba91070f706d1bc1c3ced8 | 0 | static int xan_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int ret, buf_size = avpkt->size;
XanContext *s = avctx->priv_data;
if (avctx->codec->id == CODEC_ID_XAN_WC3... | 21,663 |
FFmpeg | a1a63143f182729c40037b4fb8d8f9d84039e7ab | 0 | av_cold int MPV_encode_init(AVCodecContext *avctx)
{
MpegEncContext *s = avctx->priv_data;
int i;
int chroma_h_shift, chroma_v_shift;
MPV_encode_defaults(s);
switch (avctx->codec_id) {
case CODEC_ID_MPEG2VIDEO:
if(avctx->pix_fmt != PIX_FMT_YUV420P && avctx->pix_fmt != PIX_FMT... | 21,666 |
FFmpeg | 625b582d5a9196c582e7702b542b3e0face30ccf | 0 | static void read_sbr_envelope(SpectralBandReplication *sbr, GetBitContext *gb,
SBRData *ch_data, int ch)
{
int bits;
int i, j, k;
VLC_TYPE (*t_huff)[2], (*f_huff)[2];
int t_lav, f_lav;
const int delta = (ch == 1 && sbr->bs_coupling == 1) + 1;
const int odd =... | 21,667 |
FFmpeg | e661f760517b5843903941d5803de1890ebd8b1d | 0 | static int pva_read_packet(AVFormatContext *s, AVPacket *pkt) {
ByteIOContext *pb = s->pb;
PVAContext *pvactx = s->priv_data;
int ret, syncword, streamid, reserved, flags, length, pts_flag;
int64_t pva_pts = AV_NOPTS_VALUE;
recover:
syncword = get_be16(pb);
streamid = get_byte(pb);
... | 21,668 |
FFmpeg | 29b0d94b43ac960cb442049a5d737a3386ff0337 | 1 | static int decode_blck(uint8_t *frame, int width, int height,
const uint8_t *src, const uint8_t *src_end)
{
memset(frame, 0, width * height);
return 0;
}
| 21,669 |
qemu | a8fb542705ac7e0dcf00908bc47bf49cdd058abe | 1 | static CharDriverState *qmp_chardev_open_socket(const char *id,
ChardevBackend *backend,
ChardevReturn *ret,
Error **errp)
{
CharDriverState *chr;
TCPCharDriver *... | 21,671 |
qemu | 4c315c27661502a0813b129e41c0bf640c34a8d6 | 1 | static void pci_vpb_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
dc->realize = pci_vpb_realize;
dc->reset = pci_vpb_reset;
dc->vmsd = &pci_vpb_vmstate;
dc->props = pci_vpb_properties;
} | 21,672 |
qemu | 89da90b1b4acf24a9a3f2fd197b1bdf69ab24e72 | 1 | static void gt64120_pci_mapping(GT64120State *s)
{
/* Update IO mapping */
if ((s->regs[GT_PCI0IOLD] & 0x7f) <= s->regs[GT_PCI0IOHD])
{
/* Unmap old IO address */
if (s->PCI0IO_length)
{
memory_region_del_subregion(get_system_memory(), &s->PCI0IO_mem);
memory_r... | 21,673 |
qemu | 372579427a5040a26dfee78464b50e2bdf27ef26 | 1 | static void *qemu_dummy_cpu_thread_fn(void *arg)
{
#ifdef _WIN32
fprintf(stderr, "qtest is not supported under Windows\n");
exit(1);
#else
CPUState *cpu = arg;
sigset_t waitset;
int r;
rcu_register_thread();
qemu_mutex_lock_iothread();
qemu_thread_get_self(cpu->thread);
... | 21,674 |
qemu | eb584b401fdc0866d2ff0c03ab8b09d2ba04a49b | 1 | void target_disas(FILE *out, CPUState *cpu, target_ulong code,
target_ulong size, int flags)
{
CPUClass *cc = CPU_GET_CLASS(cpu);
target_ulong pc;
int count;
CPUDebug s;
INIT_DISASSEMBLE_INFO(s.info, out, fprintf);
s.cpu = cpu;
s.info.read_memory_func = target_... | 21,675 |
FFmpeg | b5d2bf964be338bf8e86a01619646332729b434e | 1 | static inline int decode_bytes(const uint8_t *inbuffer, uint8_t *out, int bytes)
{
static const uint32_t tab[4] = {
AV_BE2NE32C(0x37c511f2), AV_BE2NE32C(0xf237c511),
AV_BE2NE32C(0x11f237c5), AV_BE2NE32C(0xc511f237),
};
int i, off;
uint32_t c;
const uint32_t *buf;
uint32_... | 21,676 |
qemu | 4fa62005d0a85df9bb14ea9f53109d7c5f66eeb9 | 1 | static void coroutine_fn v9fs_fix_fid_paths(V9fsPDU *pdu, V9fsPath *olddir,
V9fsString *old_name,
V9fsPath *newdir,
V9fsString *new_name)
{
V9fsFidState *tfidp;
V9fsPath oldp... | 21,677 |
FFmpeg | d8edf1b515ae9fbcea2103305241d130c16e1003 | 0 | static inline void rv40_weak_loop_filter(uint8_t *src, const int step,
const int filter_p1, const int filter_q1,
const int alpha, const int beta,
const int lim_p0q0,
... | 21,678 |
FFmpeg | c0f0bec2f205e567fc0eef8a9bf59d585e14094c | 0 | 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;... | 21,679 |
FFmpeg | a4d3cf10b2ece441ae25849a66b1c11d838f9381 | 0 | static int dirac_decode_frame_internal(DiracContext *s)
{
DWTContext d;
int y, i, comp, dsty;
if (s->low_delay) {
/* [DIRAC_STD] 13.5.1 low_delay_transform_data() */
for (comp = 0; comp < 3; comp++) {
Plane *p = &s->plane[comp];
memset(p->idwt_buf, 0, p->idw... | 21,680 |
FFmpeg | ef912134f01c1fba3ab201fdf98d90ab4eb55179 | 1 | void updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrBufIndex,
int lastInLumBuf, int lastInChrBuf)
{
const int dstH= c->dstH;
const int flags= c->flags;
int16_t **lumPixBuf= c->lumPixBuf;
int16_t **chrUPixBuf= c->chrUPixBuf;
int16_t **alpPixBu... | 21,681 |
qemu | c5a49c63fa26e8825ad101dfe86339ae4c216539 | 1 | static inline void gen_outs(DisasContext *s, TCGMemOp ot)
{
if (s->base.tb->cflags & CF_USE_ICOUNT) {
gen_io_start();
}
gen_string_movl_A0_ESI(s);
gen_op_ld_v(s, ot, cpu_T0, cpu_A0);
tcg_gen_trunc_tl_i32(cpu_tmp2_i32, cpu_regs[R_EDX]);
tcg_gen_andi_i32(cpu_tmp2_i32, cpu_tmp2_i3... | 21,682 |
FFmpeg | 3715d841a619f1cbc4776d9b00575dae6fb6534a | 0 | static av_cold int alloc_buffers(AVCodecContext *avctx, AACEncContext *s)
{
FF_ALLOCZ_OR_GOTO(avctx, s->buffer.samples, 3 * 1024 * s->channels * sizeof(s->buffer.samples[0]), alloc_fail);
FF_ALLOCZ_OR_GOTO(avctx, s->cpe, sizeof(ChannelElement) * s->chan_map[0], alloc_fail);
FF_ALLOCZ_OR_GOTO(avctx, avct... | 21,684 |
FFmpeg | 7303962f1467e302906561be53ca4d51abbe5522 | 0 | void ff_aac_update_ltp(AACEncContext *s, SingleChannelElement *sce)
{
int i, j, lag;
float corr, s0, s1, max_corr = 0.0f;
float *samples = &s->planar_samples[s->cur_channel][1024];
float *pred_signal = &sce->ltp_state[0];
int samples_num = 2048;
if (s->profile != FF_PROFILE_AAC_LTP)
... | 21,686 |
FFmpeg | bcd7bf7eeb09a395cc01698842d1b8be9af483fc | 0 | void ff_biweight_h264_pixels4_8_msa(uint8_t *dst, uint8_t *src,
int stride, int height,
int log2_denom, int weight_dst,
int weight_src, int offset)
{
avc_biwgt_4width_msa(src, stride,
... | 21,687 |
FFmpeg | e45a2872fafe631c14aee9f79d0963d68c4fc1fd | 0 | void clear_blocks_dcbz128_ppc(DCTELEM *blocks)
{
POWERPC_TBL_DECLARE(powerpc_clear_blocks_dcbz128, 1);
register int misal = ((unsigned long)blocks & 0x0000007f);
register int i = 0;
POWERPC_TBL_START_COUNT(powerpc_clear_blocks_dcbz128, 1);
#if 1
if (misal) {
// we could probably also optimize this c... | 21,688 |
qemu | e62fbc54d459d4cc8e91dc0938383a7f4c13768c | 1 | static void ppc_cpu_class_init(ObjectClass *oc, void *data)
{
PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
CPUClass *cc = CPU_CLASS(oc);
DeviceClass *dc = DEVICE_CLASS(oc);
pcc->parent_realize = dc->realize;
dc->realize = ppc_cpu_realizefn;
dc->unrealize = ppc_cpu_unrealizefn;
p... | 21,689 |
qemu | 5f758366c0710d23e43f4d0f83816b98616a13d0 | 1 | static CharDriverState *qmp_chardev_open_socket(ChardevSocket *sock,
Error **errp)
{
SocketAddress *addr = sock->addr;
bool do_nodelay = sock->has_nodelay ? sock->nodelay : false;
bool is_listen = sock->has_server ? sock->server : true;
bo... | 21,690 |
FFmpeg | 6ca2465556836d20ab9ea5689960fbf1fbda0e23 | 1 | static const char *ass_split_section(ASSSplitContext *ctx, const char *buf)
{
const ASSSection *section = &ass_sections[ctx->current_section];
int *number = &ctx->field_number[ctx->current_section];
int *order = ctx->field_order[ctx->current_section];
int *tmp, i, len;
while (buf && *buf) {
... | 21,692 |
FFmpeg | 28bf81c90d36a55cf76e2be913c5215ebebf61f2 | 1 | static inline void yuv2rgbXinC(int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
uint8_t *dest, int dstW, int dstbpp)
{
if(dstbpp==32)
{
int i;
for(i=0; i<(dstW>>1); i++){
int j;
int Y1=0;
int Y2=0;
int U=0;
... | 21,693 |
FFmpeg | 56c7e1059ab993da68caa3847372f3fb5e010dc4 | 1 | static int halfpel_interpol(SnowContext *s, uint8_t *halfpel[4][4], AVFrame *frame){
int p,x,y;
for(p=0; p < s->nb_planes; p++){
int is_chroma= !!p;
int w= is_chroma ? s->avctx->width >>s->chroma_h_shift : s->avctx->width;
int h= is_chroma ? s->avctx->height>>s->chroma_v_shift : s... | 21,695 |
qemu | ea9ebc2ce69198f7aca4b43652824c5d621ac978 | 1 | static void *qpa_thread_in (void *arg)
{
PAVoiceIn *pa = arg;
HWVoiceIn *hw = &pa->hw;
if (audio_pt_lock (&pa->pt, AUDIO_FUNC)) {
return NULL;
}
for (;;) {
int incr, to_grab, wpos;
for (;;) {
if (pa->done) {
goto exit;
... | 21,696 |
FFmpeg | 073c2593c9f0aa4445a6fc1b9b24e6e52a8cc2c1 | 1 | void ff_h261_encode_init(MpegEncContext *s){
static int done = 0;
if (!done) {
done = 1;
init_rl(&h261_rl_tcoeff);
}
s->min_qcoeff= -127;
s->max_qcoeff= 127;
s->y_dc_scale_table=
s->c_dc_scale_table= ff_mpeg1_dc_scale_table;
}
| 21,697 |
qemu | 5a123b3c1a1d3540d4455772c42c466870d81061 | 1 | static int mmu_translate_region(CPUS390XState *env, target_ulong vaddr,
uint64_t asc, uint64_t entry, int level,
target_ulong *raddr, int *flags, int rw,
bool exc)
{
CPUState *cs = CPU(s390_env_get_cpu(env));
u... | 21,698 |
FFmpeg | ad1c50255735c20bd86572d3e8b3c88a5ca6c8f1 | 1 | static int pcx_encode_frame(AVCodecContext *avctx,
unsigned char *buf, int buf_size, void *data)
{
PCXContext *s = avctx->priv_data;
AVFrame *const pict = &s->picture;
const uint8_t *buf_start = buf;
const uint8_t *buf_end = buf + buf_size;
int bpp, nplanes, i,... | 21,699 |
qemu | 332cc7e9b39ddb2feacb4c71dcd18c3e5b0c3147 | 1 | static void GCC_FMT_ATTR(2, 3) qtest_send(CharDriverState *chr,
const char *fmt, ...)
{
va_list ap;
char buffer[1024];
size_t len;
va_start(ap, fmt);
len = vsnprintf(buffer, sizeof(buffer), fmt, ap);
va_end(ap);
qemu_chr_fe_write_all(chr... | 21,700 |
FFmpeg | a392bf657015c9a79a5a13adfbfb15086c1943b9 | 1 | static int dxtory_decode_v1_rgb(AVCodecContext *avctx, AVFrame *pic,
const uint8_t *src, int src_size,
int id, int bpp)
{
int h;
uint8_t *dst;
int ret;
if (src_size < avctx->width * avctx->height * bpp) {
av_log(avctx, AV_... | 21,701 |
qemu | 3bf1817079bb0d80c0d8a86a7c7dd0bfe90eb82e | 1 | void vbe_ioport_write_data(void *opaque, uint32_t addr, uint32_t val)
{
VGACommonState *s = opaque;
if (s->vbe_index <= VBE_DISPI_INDEX_NB) {
#ifdef DEBUG_BOCHS_VBE
printf("VBE: write index=0x%x val=0x%x\n", s->vbe_index, val);
#endif
switch(s->vbe_index) {
case VBE_DISPI_INDEX... | 21,702 |
qemu | f8ed85ac992c48814d916d5df4d44f9a971c5de4 | 1 | static void vexpress_common_init(MachineState *machine)
{
VexpressMachineState *vms = VEXPRESS_MACHINE(machine);
VexpressMachineClass *vmc = VEXPRESS_MACHINE_GET_CLASS(machine);
VEDBoardInfo *daughterboard = vmc->daughterboard;
DeviceState *dev, *sysctl, *pl041;
qemu_irq pic[64];
uint32_t... | 21,703 |
qemu | 3e305e4a4752f70c0b5c3cf5b43ec957881714f7 | 1 | static int vnc_set_gnutls_priority(gnutls_session_t s, int x509)
{
const char *priority = x509 ? "NORMAL" : "NORMAL:+ANON-DH";
int rc;
rc = gnutls_priority_set_direct(s, priority, NULL);
if (rc != GNUTLS_E_SUCCESS) {
return -1;
}
return 0;
}
| 21,705 |
qemu | a5b39cd3f647eaaaef5b648beda5cb2f387418c0 | 1 | static void vfio_platform_eoi(VFIODevice *vbasedev)
{
VFIOINTp *intp;
VFIOPlatformDevice *vdev =
container_of(vbasedev, VFIOPlatformDevice, vbasedev);
qemu_mutex_lock(&vdev->intp_mutex);
QLIST_FOREACH(intp, &vdev->intp_list, next) {
if (intp->state == VFIO_IRQ_ACTIVE) {
... | 21,706 |
qemu | a703d3aef5991b72a5a45880e7491232b8032f09 | 1 | static void qxl_enter_vga_mode(PCIQXLDevice *d)
{
if (d->mode == QXL_MODE_VGA) {
return;
}
trace_qxl_enter_vga_mode(d->id);
#if SPICE_SERVER_VERSION >= 0x000c03 /* release 0.12.3 */
spice_qxl_driver_unload(&d->ssd.qxl);
#endif
graphic_console_set_hwops(d->ssd.dcl.con, d->vga.hw_ops,... | 21,707 |
FFmpeg | 5c720657c23afd798ae0db7c7362eb859a89ab3d | 1 | static int mov_read_smi(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
if (c->fc->nb_streams < 1)
return 0;
st = c->fc->streams[c->fc->nb_streams-1];
if ((uint64_t)atom.size > (1<<30))
return AVERROR_INVALIDDATA;
// currently SVQ3 decoder expect full STSD... | 21,709 |
FFmpeg | 37e0b997a8d6695abb0dd4bac886a86104d68a3c | 0 | AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b)
{
AVFilterFormats *ret;
unsigned i, j, k = 0;
ret = av_mallocz(sizeof(AVFilterFormats));
/* merge list of formats */
ret->formats = av_malloc(sizeof(*ret->formats) * FFMIN(a->format_count,
... | 21,710 |
FFmpeg | d8edf1b515ae9fbcea2103305241d130c16e1003 | 0 | static void rv40_v_loop_filter(uint8_t *src, int stride, int dmode,
int lim_q1, int lim_p1,
int alpha, int beta, int beta2, int chroma, int edge){
rv40_adaptive_loop_filter(src, 1, stride, dmode, lim_q1, lim_p1,
alpha, b... | 21,711 |
FFmpeg | a6191d098a03f94685ae4c072bfdf10afcd86223 | 0 | static void lfe_downsample(DCAEncContext *c, const int32_t *input)
{
/* FIXME: make 128x LFE downsampling possible */
const int lfech = lfe_index[c->channel_config];
int i, j, lfes;
int32_t hist[512];
int32_t accum;
int hist_start = 0;
for (i = 0; i < 512; i++)
hist[i] = c... | 21,712 |
FFmpeg | 274aa1d02f12aba969b280139cf79907134dcd89 | 0 | static int indeo3_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
const uint8_t *buf, int buf_size)
{
Indeo3DecodeContext *s=avctx->priv_data;
uint8_t *src, *dest;
int y;
iv_decode_frame(s, buf, buf_size);
if(s... | 21,713 |
FFmpeg | 3ebc7e04dea6072400d91c1c90eb3911754cee06 | 0 | static void filter_mb_edgech( H264Context *h, uint8_t *pix, int stride, int bS[4], int qp ) {
int i, d;
const int index_a = clip( qp + h->slice_alpha_c0_offset, 0, 51 );
const int alpha = alpha_table[index_a];
const int beta = beta_table[clip( qp + h->slice_beta_offset, 0, 51 )];
const int pix... | 21,714 |
qemu | c2b38b277a7882a592f4f2ec955084b2b756daaa | 0 | void aio_context_unref(AioContext *ctx)
{
g_source_unref(&ctx->source);
}
| 21,715 |
qemu | 2399d4e7cec22ecf1c51062d2ebfd45220dbaace | 0 | static void handle_hint(DisasContext *s, uint32_t insn,
unsigned int op1, unsigned int op2, unsigned int crm)
{
unsigned int selector = crm << 3 | op2;
if (op1 != 3) {
unallocated_encoding(s);
return;
}
switch (selector) {
case 0: /* NOP */
... | 21,716 |
FFmpeg | c919e1ca2ecfc47d796382973ba0e48b8f6f92a2 | 0 | static int msrle_decode_frame(AVCodecContext *avctx,
void *data, int *got_frame,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
MsrleContext *s = avctx->priv_data;
int istride = FFALIGN(avctx->width*avct... | 21,717 |
qemu | b3ceef24f4fee8d5ed96b8c4a5d3e80c0a651f0b | 0 | static void tcx_update_display(void *opaque)
{
TCXState *ts = opaque;
ram_addr_t page, page_min, page_max;
int y, y_start, dd, ds;
uint8_t *d, *s;
void (*f)(TCXState *s1, uint8_t *d, const uint8_t *s, int width);
if (ts->ds->depth == 0)
return;
page = ts->vram_offset;
y_star... | 21,718 |
qemu | 245f7b51c0ea04fb2224b1127430a096c91aee70 | 0 | int vnc_zlib_send_framebuffer_update(VncState *vs, int x, int y, int w, int h)
{
int old_offset, new_offset, bytes_written;
vnc_framebuffer_update(vs, x, y, w, h, VNC_ENCODING_ZLIB);
// remember where we put in the follow-up size
old_offset = vs->output.offset;
vnc_write_s32(vs, 0);
... | 21,719 |
qemu | 90e496386fe7fd32c189561f846b7913f95b8cf4 | 0 | static TCGv_i64 read_fp_dreg(DisasContext *s, int reg)
{
TCGv_i64 v = tcg_temp_new_i64();
tcg_gen_ld_i64(v, cpu_env, fp_reg_offset(reg, MO_64));
return v;
}
| 21,720 |
qemu | 2e4109de8e589beecd69996ee14f24021b991c0d | 0 | static int vfio_connect_container(VFIOGroup *group, AddressSpace *as)
{
VFIOContainer *container;
int ret, fd;
VFIOAddressSpace *space;
space = vfio_get_address_space(as);
QLIST_FOREACH(container, &space->containers, next) {
if (!ioctl(group->fd, VFIO_GROUP_SET_CONTAINER, &contain... | 21,721 |
qemu | ee951a37d8873bff7aa58e23222dfd984111b6cb | 0 | static void pci_piix_init_ports(PCIIDEState *d) {
int i;
struct {
int iobase;
int iobase2;
int isairq;
} port_info[] = {
{0x1f0, 0x3f6, 14},
{0x170, 0x376, 15},
};
for (i = 0; i < 2; i++) {
ide_bus_new(&d->bus[i], &d->dev.qdev, i);
... | 21,722 |
qemu | 3acace1333d6b75628fe6e6786ad3cd2db766f0e | 0 | void load_seg(int seg_reg, int selector)
{
SegmentCache *sc;
SegmentDescriptorTable *dt;
int index;
uint32_t e1, e2;
uint8_t *ptr;
env->segs[seg_reg] = selector;
sc = &env->seg_cache[seg_reg];
if (env->eflags & VM_MASK) {
sc->base = (void *)(selector << 4);
s... | 21,724 |
qemu | 40119effc5c36dbd0ca19ca85a5897d5b3d37d6d | 0 | static BlockBackend *blockdev_init(const char *file, QDict *bs_opts,
Error **errp)
{
const char *buf;
int bdrv_flags = 0;
int on_read_error, on_write_error;
bool account_invalid, account_failed;
const char *stats_intervals;
BlockBackend *blk;
Block... | 21,725 |
FFmpeg | 70d54392f5015b9c6594fcae558f59f952501e3b | 0 | av_cold void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx)
{
if (avctx->bits_per_raw_sample <= 8 &&
(avctx->idct_algo == FF_IDCT_AUTO ||
avctx->idct_algo == FF_IDCT_SIMPLEARMV5TE)) {
c->idct_put = ff_simple_idct_put_armv5te;
c->idct_add ... | 21,727 |
qemu | 09e68369a88d7de0f988972bf28eec1b80cc47f9 | 0 | static QObject *qmp_input_get_object(QmpInputVisitor *qiv,
const char *name,
bool consume, Error **errp)
{
StackObject *tos;
QObject *qobj;
QObject *ret;
if (QSLIST_EMPTY(&qiv->stack)) {
/* Starting at root, name... | 21,728 |
qemu | 46c5874e9cd752ed8ded31af03472edd8fc3efc1 | 0 | static void rtas_ibm_set_slot_reset(PowerPCCPU *cpu,
sPAPREnvironment *spapr,
uint32_t token, uint32_t nargs,
target_ulong args, uint32_t nret,
target_ulong rets)
{
s... | 21,729 |
qemu | 496272a7018ba01aa2b87a1a5ed866ff85133401 | 0 | int pp_check(int key, int pp, int nx)
{
int access;
/* Compute access rights */
/* When pp is 3/7, the result is undefined. Set it to noaccess */
access = 0;
if (key == 0) {
switch (pp) {
case 0x0:
case 0x1:
case 0x2:
access |= PAGE_WRITE;
... | 21,730 |
qemu | 59f39a47411ab6007a592555dc639aa9753f8d23 | 0 | static bool check_section_footer(QEMUFile *f, SaveStateEntry *se)
{
uint8_t read_mark;
uint32_t read_section_id;
if (skip_section_footers) {
/* No footer to check */
return true;
}
read_mark = qemu_get_byte(f);
if (read_mark != QEMU_VM_SECTION_FOOTER) {
er... | 21,732 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.