project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | 5d739a4787a53da8d787551c8de27ad39fabdb34 | 0 | static void virtio_setup(uint64_t dev_info)
{
struct schib schib;
int i;
int r;
bool found = false;
bool check_devno = false;
uint16_t dev_no = -1;
blk_schid.one = 1;
if (dev_info != -1) {
check_devno = true;
dev_no = dev_info & 0xffff;
debug_print_i... | 26,002 |
qemu | 26a83ad0e793465b74a8b06a65f2f6fdc5615413 | 0 | void memory_region_init_ram(MemoryRegion *mr,
const char *name,
uint64_t size)
{
memory_region_init(mr, name, size);
mr->ram = true;
mr->terminates = true;
mr->destructor = memory_region_destructor_ram;
mr->ram_addr = qemu_ram_alloc(siz... | 26,004 |
qemu | 678421650dc166cd6cb35bb2bc0baf1b481b40ca | 0 | static uint64_t pchip_read(void *opaque, hwaddr addr, unsigned size)
{
TyphoonState *s = opaque;
uint64_t ret = 0;
if (addr & 4) {
return s->latch_tmp;
}
switch (addr) {
case 0x0000:
/* WSBA0: Window Space Base Address Register. */
ret = s->pchip.win[0].bas... | 26,005 |
qemu | 36eb6e096729f9aade3a6af7dbe4d0a990335d7e | 0 | void cpu_x86_update_dr7(CPUX86State *env, uint32_t new_dr7)
{
int i;
for (i = 0; i < DR7_MAX_BP; i++) {
hw_breakpoint_remove(env, i);
}
env->dr[7] = new_dr7;
for (i = 0; i < DR7_MAX_BP; i++) {
hw_breakpoint_insert(env, i);
}
}
| 26,006 |
FFmpeg | be4dfbf7b71e44a53ca8da882a081e35ea134c83 | 0 | int ffurl_get_file_handle(URLContext *h)
{
if (!h->prot->url_get_file_handle)
return -1;
return h->prot->url_get_file_handle(h);
}
| 26,009 |
qemu | 7a2c4b82340d621bff462672b29c88d2020d68c1 | 0 | static void cmd_read_toc_pma_atip(IDEState *s, uint8_t* buf)
{
int format, msf, start_track, len;
uint64_t total_sectors = s->nb_sectors >> 2;
int max_len;
if (total_sectors == 0) {
ide_atapi_cmd_error(s, SENSE_NOT_READY, ASC_MEDIUM_NOT_PRESENT);
return;
}
max_len = ... | 26,010 |
FFmpeg | 507dce2536fea4b78a9f4973f77e1fa20cfe1b81 | 0 | av_cold void ff_rv40dsp_init(RV34DSPContext *c, DSPContext* dsp) {
ff_rv34dsp_init(c, dsp);
c->put_pixels_tab[0][ 0] = dsp->put_h264_qpel_pixels_tab[0][0];
c->put_pixels_tab[0][ 1] = put_rv40_qpel16_mc10_c;
c->put_pixels_tab[0][ 2] = dsp->put_h264_qpel_pixels_tab[0][2];
c->put_pixels_tab[0]... | 26,011 |
FFmpeg | f7f88018393b96ae410041e9a0fc51f4c082002e | 0 | static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length)
{
int i, consumed, ret = 0;
s->ref = NULL;
s->eos = 0;
/* split the input packet into NAL units, so we know the upper bound on the
* number of slices in the frame */
s->nb_nals = 0;
while (length >= 4) {... | 26,012 |
qemu | af4b6c54c141c1e2d3637fc15b912e82b88828cf | 0 | static always_inline void gen_intermediate_code_internal (CPUState *env,
TranslationBlock *tb,
int search_pc)
{
DisasContext ctx, *ctxp = &ctx;
opc_handler_t **table, *handler;
target_ul... | 26,013 |
qemu | eacc324914c2dc7aecec3b4ea920252b685b5c8e | 0 | static int slb_lookup (CPUPPCState *env, target_ulong eaddr,
target_ulong *vsid, target_ulong *page_mask, int *attr)
{
target_phys_addr_t sr_base;
target_ulong mask;
uint64_t tmp64;
uint32_t tmp;
int n, ret;
int slb_nr;
ret = -5;
sr_base = env->spr[SPR_... | 26,014 |
qemu | 7fd669a1c49743073e53166798244f15b1a8e0d2 | 0 | static const mon_cmd_t *monitor_parse_command(Monitor *mon,
const char *cmdline,
QDict *qdict)
{
const char *p, *typestr;
int c;
const mon_cmd_t *cmd;
char cmdname[256];
char buf[1024];
char *key... | 26,015 |
qemu | d85f4222b4681da7ebf8a90b26e085a68fa2c55a | 0 | static coroutine_fn int qcow_co_writev(BlockDriverState *bs, int64_t sector_num,
int nb_sectors, QEMUIOVector *qiov)
{
BDRVQcowState *s = bs->opaque;
int index_in_cluster;
uint64_t cluster_offset;
int ret = 0, n;
struct iovec hd_iov;
QEMUIOVector hd_qiov;
u... | 26,016 |
qemu | 7e7e2ebc942da8285931ceabf12823e165dced8b | 0 | static void start_auth_vencrypt_subauth(VncState *vs)
{
switch (vs->vd->subauth) {
case VNC_AUTH_VENCRYPT_TLSNONE:
case VNC_AUTH_VENCRYPT_X509NONE:
VNC_DEBUG("Accept TLS auth none\n");
vnc_write_u32(vs, 0); /* Accept auth completion */
start_client_init(vs);
break;
... | 26,017 |
qemu | 42a268c241183877192c376d03bd9b6d527407c7 | 0 | static void disas_test_b_imm(DisasContext *s, uint32_t insn)
{
unsigned int bit_pos, op, rt;
uint64_t addr;
int label_match;
TCGv_i64 tcg_cmp;
bit_pos = (extract32(insn, 31, 1) << 5) | extract32(insn, 19, 5);
op = extract32(insn, 24, 1); /* 0: TBZ; 1: TBNZ */
addr = s->pc + sextrac... | 26,019 |
qemu | 65c0f1e9558c7c762cdb333406243fff1d687117 | 0 | static QObject *parse_escape(JSONParserContext *ctxt, QList **tokens, va_list *ap)
{
QObject *token = NULL, *obj;
QList *working = qlist_copy(*tokens);
if (ap == NULL) {
goto out;
}
token = qlist_pop(working);
if (token == NULL) {
goto out;
}
if (token_is... | 26,020 |
qemu | defdb20e1a8ac3a7200aaf190d7fb20a5ac8bcea | 0 | ParallelState *parallel_mm_init(target_phys_addr_t base, int it_shift, qemu_irq irq, CharDriverState *chr)
{
ParallelState *s;
int io_sw;
s = qemu_mallocz(sizeof(ParallelState));
s->irq = irq;
s->chr = chr;
s->it_shift = it_shift;
qemu_register_reset(parallel_reset, s);
io_s... | 26,021 |
qemu | f090c9d4ad5812fb92843d6470a1111c15190c4c | 0 | int float32_le( float32 a, float32 b STATUS_PARAM )
{
flag aSign, bSign;
if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) )
|| ( ( extractFloat32Exp( b ) == 0xFF ) && extractFloat32Frac( b ) )
) {
float_raise( float_flag_invalid STATUS_VAR);
return... | 26,022 |
FFmpeg | 2e988fd689642899927707a084bf40dc1326dc90 | 0 | static void ttafilter_init(TTAContext *s, TTAFilter *c, int32_t shift) {
memset(c, 0, sizeof(TTAFilter));
if (s->pass) {
int i;
for (i = 0; i < 8; i++)
c->qm[i] = sign_extend(s->crc_pass[i], 8);
}
c->shift = shift;
c->round = shift_1[shift-1];
// c->round = 1 <... | 26,023 |
qemu | bb5fc20f7c1c65e95030da3629dd0d7a0cce38cd | 0 | USBDevice *usb_msd_init(const char *filename, BlockDriverState **pbs)
{
MSDState *s;
BlockDriverState *bdrv;
BlockDriver *drv = NULL;
const char *p1;
char fmt[32];
p1 = strchr(filename, ':');
if (p1++) {
const char *p2;
if (strstart(filename, "format=", &p2)) {
... | 26,024 |
qemu | 0d82d0e8b98cf0ea03a45f8542d835ebd3a84cd3 | 0 | static int buffered_rate_limit(void *opaque)
{
QEMUFileBuffered *s = opaque;
int ret;
ret = qemu_file_get_error(s->file);
if (ret) {
return ret;
}
if (s->bytes_xfer > s->xfer_limit)
return 1;
return 0;
}
| 26,025 |
qemu | a3f1afb43a09e4577571c044c48f2ba9e6e4ad06 | 0 | static int alloc_refcount_block(BlockDriverState *bs,
int64_t cluster_index, void **refcount_block)
{
BDRVQcowState *s = bs->opaque;
unsigned int refcount_table_index;
int ret;
BLKDBG_EVENT(bs->file, BLKDBG_REFBLOCK_ALLOC);
/* Find the refcount block for th... | 26,026 |
FFmpeg | 95b192de5d05f3e1542e7b2378cdefbc195f5185 | 0 | static inline int vc1_pred_dc(MpegEncContext *s, int overlap, int pq, int n,
int a_avail, int c_avail,
int16_t **dc_val_ptr, int *dir_ptr)
{
int a, b, c, wrap, pred;
int16_t *dc_val;
int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
int q1,... | 26,028 |
qemu | 57b6bdf37c64985cf02b8737c550d52759059c9d | 1 | static void external_snapshot_prepare(BlkTransactionState *common,
Error **errp)
{
BlockDriver *drv;
int flags, ret;
QDict *options = NULL;
Error *local_err = NULL;
bool has_device = false;
const char *device;
bool has_node_name = false;
co... | 26,029 |
FFmpeg | ab2940691ba76e1a9b0ce608db0dfc45021d741e | 0 | int avio_get_str(AVIOContext *s, int maxlen, char *buf, int buflen)
{
int i;
// reserve 1 byte for terminating 0
buflen = FFMIN(buflen - 1, maxlen);
for (i = 0; i < buflen; i++)
if (!(buf[i] = avio_r8(s)))
return i + 1;
if (buflen)
buf[i] = 0;
for (; i < m... | 26,032 |
FFmpeg | d1adad3cca407f493c3637e20ecd4f7124e69212 | 0 | static int RENAME(swScale)(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[])
{
/* load a few things into local vars to make the code more readable? and faster */
const int srcW= c->srcW;
const int dstW= c->dst... | 26,033 |
FFmpeg | d90c5bf10559554d6f9cd1dfb90767b991b76d5d | 1 | static inline int wv_unpack_mono(WavpackFrameContext *s, GetBitContext *gb,
void *dst, const int type)
{
int i, j, count = 0;
int last, t;
int A, S, T;
int pos = s->pos;
uint32_t crc = s->sc.crc;
uint32_t crc_extra_bits = s->... | 26,034 |
qemu | 51cc2e783af5586b2e742ce9e5b2762dc50ad325 | 1 | static void mmu_init (CPUMIPSState *env, const mips_def_t *def)
{
env->tlb = qemu_mallocz(sizeof(CPUMIPSTLBContext));
switch (def->mmu_type) {
case MMU_TYPE_NONE:
no_mmu_init(env, def);
break;
case MMU_TYPE_R4000:
r4k_mmu_init(env, def);
... | 26,035 |
FFmpeg | 05b7a635dc1e5266fb367ce8b0019a0830317879 | 1 | static void sample_queue_push(HintSampleQueue *queue, uint8_t *data, int size,
int sample)
{
/* No need to keep track of smaller samples, since describing them
* with immediates is more efficient. */
if (size <= 14)
return;
if (!queue->samples || queue->len ... | 26,036 |
qemu | 45ed0be146b7433d1123f09eb1a984210a311625 | 1 | static void gen_spr_power8_tce_address_control(CPUPPCState *env)
{
spr_register(env, SPR_TAR, "TAR",
&spr_read_generic, &spr_write_generic,
&spr_read_generic, &spr_write_generic,
0x00000000);
}
| 26,039 |
FFmpeg | ce3bcaeda1dec8bdc25d4daf5a8358feafe5d124 | 1 | static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
int n, int coded, int intra)
{
int level, i, last, run;
int dc_pred_dir;
RLTable * rl;
RL_VLC_ELEM * rl_vlc;
const UINT8 * scan_table;
int qmul, qadd;
if(intra) {
/* DC coef *... | 26,040 |
qemu | 265ca29a7162a9437efabdb3b133237eef49ab7b | 1 | int load_uboot(const char *filename, target_ulong *ep, int *is_linux)
{
int fd;
int size;
uboot_image_header_t h;
uboot_image_header_t *hdr = &h;
uint8_t *data = NULL;
fd = open(filename, O_RDONLY | O_BINARY);
if (fd < 0)
return -1;
size = read(fd, hdr, sizeof(ubo... | 26,041 |
qemu | 25408c09502be036e5575754fe54019ed4ed5dfa | 1 | static int64_t alloc_refcount_block(BlockDriverState *bs, int64_t cluster_index)
{
BDRVQcowState *s = bs->opaque;
unsigned int refcount_table_index;
int ret;
BLKDBG_EVENT(bs->file, BLKDBG_REFBLOCK_ALLOC);
/* Find the refcount block for the given cluster */
refcount_table_index = clust... | 26,042 |
FFmpeg | 42d73f7f6bea0ee0f64a3ad4882860ce5b923a11 | 1 | static int parse_vtrk(AVFormatContext *s,
FourxmDemuxContext *fourxm, uint8_t *buf, int size)
{
AVStream *st;
/* check that there is enough data */
if (size != vtrk_SIZE) {
return AVERROR_INVALIDDATA;
}
/* allocate a new AVStream */
st = avformat_new_stre... | 26,043 |
qemu | bb00021de0b5908bc2c3ca467ad9a2b0c9c36459 | 1 | void bdrv_set_backing_hd(BlockDriverState *bs, BlockDriverState *backing_hd)
{
if (bs->backing_hd) {
assert(bs->backing_blocker);
bdrv_op_unblock_all(bs->backing_hd, bs->backing_blocker);
} else if (backing_hd) {
error_setg(&bs->backing_blocker,
"device is use... | 26,044 |
qemu | a1f0cce2ac0243572ff72aa561da67fe3766a395 | 1 | static void scsi_command_complete(void *opaque, int ret)
{
SCSIGenericReq *r = (SCSIGenericReq *)opaque;
SCSIGenericState *s = DO_UPCAST(SCSIGenericState, qdev, r->req.dev);
r->req.aiocb = NULL;
s->driver_status = r->io_header.driver_status;
if (s->driver_status & SG_ERR_DRIVER_SENSE)
... | 26,045 |
qemu | 7453c96b78c2b09aa72924f933bb9616e5474194 | 1 | static int QEMU_WARN_UNUSED_RESULT update_refcount(BlockDriverState *bs,
int64_t offset,
int64_t length,
uint64_t addend,
... | 26,046 |
FFmpeg | 37216b99e090a88d98be57a8aab14a8316b96a71 | 0 | int ff_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf, int buf_size)
{
GetBitContext gb;
int specific_config_bitindex;
init_get_bits(&gb, buf, buf_size*8);
c->object_type = get_object_type(&gb);
c->sample_rate = get_sample_rate(&gb, &c->sampling_index);
c->chan_config = g... | 26,047 |
FFmpeg | 97bb456b6b787bb36e2785072e604ba0db9a43df | 0 | void ff_hevc_luma_mv_mvp_mode(HEVCContext *s, int x0, int y0, int nPbW,
int nPbH, int log2_cb_size, int part_idx,
int merge_idx, MvField *mv,
int mvp_lx_flag, int LX)
{
HEVCLocalContext *lc = s->HEVClc;
MvField *tab_... | 26,048 |
qemu | 07fb61760cdea7c3f1b9c897513986945bca8e89 | 1 | static void pc_compat_2_0(MachineState *machine)
{
smbios_legacy_mode = true;
has_reserved_memory = false;
} | 26,050 |
qemu | 71200fb9664c2967a1cdd22b68b0da3a8b2b3eb7 | 1 | static CharDriverState *qemu_chr_open_msmouse(const char *id,
ChardevBackend *backend,
ChardevReturn *ret,
Error **errp)
{
ChardevCommon *common = backend->u.msmouse.data;
... | 26,051 |
qemu | 3c85e74fbf9e5a39d8d13ef91a5f3dd91f0bc8a8 | 1 | int kvm_arch_on_sigbus_vcpu(CPUState *env, int code, void *addr)
{
#ifdef KVM_CAP_MCE
ram_addr_t ram_addr;
target_phys_addr_t paddr;
if ((env->mcg_cap & MCG_SER_P) && addr
&& (code == BUS_MCEERR_AR || code == BUS_MCEERR_AO)) {
if (qemu_ram_addr_from_host(addr, &ram_addr) ||
... | 26,052 |
FFmpeg | 6f3e4e1712260ef8c5b4754d781ccd80bcfa1d0c | 1 | static int vc1_decode_intra_block(VC1Context *v, DCTELEM block[64], int n, int coded, int mquant, int codingset)
{
GetBitContext *gb = &v->s.gb;
MpegEncContext *s = &v->s;
int dc_pred_dir = 0; /* Direction of the DC prediction used */
int run_diff, i;
int16_t *dc_val;
int16_t *ac_val, *ac... | 26,053 |
FFmpeg | e494f44c051d7dccc038a603ab22532b87dd1705 | 0 | static int can_safely_read(GetBitContext* gb, uint64_t bits) {
return get_bits_left(gb) >= bits;
}
| 26,054 |
FFmpeg | 87e8788680e16c51f6048af26f3f7830c35207a5 | 0 | static int tta_probe(AVProbeData *p)
{
const uint8_t *d = p->buf;
if (p->buf_size < 4)
return 0;
if (d[0] == 'T' && d[1] == 'T' && d[2] == 'A' && d[3] == '1')
return 80;
return 0;
}
| 26,055 |
qemu | 08546bcfb260c28141e27cf3367c443528602fc0 | 0 | static void qcow2_cache_table_release(BlockDriverState *bs, Qcow2Cache *c,
int i, int num_tables)
{
/* Using MADV_DONTNEED to discard memory is a Linux-specific feature */
#ifdef CONFIG_LINUX
BDRVQcow2State *s = bs->opaque;
void *t = qcow2_cache_get_table_addr(bs, c, ... | 26,056 |
qemu | 4a1418e07bdcfaa3177739e04707ecaec75d89e1 | 0 | static void qpi_init(void)
{
kqemu_comm_base = 0xff000000 | 1;
qpi_io_memory = cpu_register_io_memory(
qpi_mem_read,
qpi_mem_write, NULL);
cpu_register_physical_memory(kqemu_comm_base & ~0xfff,
... | 26,057 |
qemu | 7bccf57383cca60a778d5c543ac80c9f62d89ef2 | 0 | tight_detect_smooth_image(VncState *vs, int w, int h)
{
uint errors;
int compression = vs->tight.compression;
int quality = vs->tight.quality;
if (!vs->vd->lossy) {
return 0;
}
if (ds_get_bytes_per_pixel(vs->ds) == 1 ||
vs->clientds.pf.bytes_per_pixel == 1 ||
... | 26,058 |
FFmpeg | 931da6a5e9dd54563fe5d4d30b7bd4d0a0218c87 | 0 | static void list_formats(AVFormatContext *ctx, int type)
{
const struct video_data *s = ctx->priv_data;
struct v4l2_fmtdesc vfd = { .type = V4L2_BUF_TYPE_VIDEO_CAPTURE };
while(!v4l2_ioctl(s->fd, VIDIOC_ENUM_FMT, &vfd)) {
enum AVCodecID codec_id = avpriv_fmt_v4l2codec(vfd.pixelformat);
... | 26,060 |
qemu | d0d7708ba29cbcc343364a46bff981e0ff88366f | 0 | static CharDriverState *qemu_chr_open_pp_fd(int fd, Error **errp)
{
CharDriverState *chr;
ParallelCharDriver *drv;
if (ioctl(fd, PPCLAIM) < 0) {
error_setg_errno(errp, errno, "not a parallel port");
close(fd);
return NULL;
}
drv = g_new0(ParallelCharDriver, 1);
... | 26,062 |
qemu | 13f59ae8157e8ec238fa8aefe5309909a1eeb7e2 | 0 | static QError *qerror_from_info(const char *fmt, va_list *va)
{
QError *qerr;
qerr = qerror_new();
loc_save(&qerr->loc);
qerr->error = error_obj_from_fmt_no_fail(fmt, va);
qerr->err_msg = qerror_format(fmt, qerr->error);
return qerr;
}
| 26,063 |
qemu | cc84de9570ffe01a9c3c169bd62ab9586a9a080c | 0 | static void unblock_io_signals(void)
{
sigset_t set;
sigemptyset(&set);
sigaddset(&set, SIGUSR2);
sigaddset(&set, SIGIO);
sigaddset(&set, SIGALRM);
pthread_sigmask(SIG_UNBLOCK, &set, NULL);
sigemptyset(&set);
sigaddset(&set, SIGUSR1);
pthread_sigmask(SIG_BLOCK, &set, NU... | 26,064 |
qemu | 7385aed20db5d83979f683b9d0048674411e963c | 0 | float32 helper_fqtos(CPUSPARCState *env)
{
float32 ret;
clear_float_exceptions(env);
ret = float128_to_float32(QT1, &env->fp_status);
check_ieee_exceptions(env);
return ret;
}
| 26,065 |
qemu | f090c9d4ad5812fb92843d6470a1111c15190c4c | 0 | float32 float32_round_to_int( float32 a STATUS_PARAM)
{
flag aSign;
int16 aExp;
bits32 lastBitMask, roundBitsMask;
int8 roundingMode;
float32 z;
aExp = extractFloat32Exp( a );
if ( 0x96 <= aExp ) {
if ( ( aExp == 0xFF ) && extractFloat32Frac( a ) ) {
return pr... | 26,066 |
qemu | 13b9414b5798539e2dbb87a570d96184fe21edf4 | 0 | static void do_drive_backup(DriveBackup *backup, BlockJobTxn *txn, Error **errp)
{
BlockDriverState *bs;
BlockDriverState *target_bs;
BlockDriverState *source = NULL;
BdrvDirtyBitmap *bmap = NULL;
AioContext *aio_context;
QDict *options = NULL;
Error *local_err = NULL;
int flags... | 26,067 |
qemu | d85f4222b4681da7ebf8a90b26e085a68fa2c55a | 0 | static int encrypt_sectors(BDRVQcowState *s, int64_t sector_num,
uint8_t *buf, int nb_sectors, bool enc,
Error **errp)
{
union {
uint64_t ll[2];
uint8_t b[16];
} ivec;
int i;
int ret;
for(i = 0; i < nb_sectors; i++) {
... | 26,068 |
qemu | a12a712a7dfbd2e2f4882ef2c90a9b2162166dd7 | 0 | static void nbd_teardown_connection(BlockDriverState *bs)
{
NBDClientSession *client = nbd_get_client_session(bs);
if (!client->ioc) { /* Already closed */
return;
}
/* finish any pending coroutines */
qio_channel_shutdown(client->ioc,
QIO_CHANNEL_SHUTDOW... | 26,070 |
FFmpeg | 7056f13a89da1d1f4afd5c6342e7ca6824777125 | 0 | static int cinepak_decode_strip (CinepakContext *s,
cvid_strip *strip, const uint8_t *data, int size)
{
const uint8_t *eod = (data + size);
int chunk_id, chunk_size;
/* coordinate sanity checks */
if (strip->x1 >= s->width || strip->x2 > s->width ||
... | 26,071 |
qemu | 08844473820c93541fc47bdfeae0f2cc88cfab59 | 0 | static int coroutine_fn bdrv_driver_pwritev(BlockDriverState *bs,
uint64_t offset, uint64_t bytes,
QEMUIOVector *qiov, int flags)
{
BlockDriver *drv = bs->drv;
int64_t sector_num = offset >> BDRV_SECTOR_BITS;
unsig... | 26,072 |
qemu | b3ceef24f4fee8d5ed96b8c4a5d3e80c0a651f0b | 0 | static void ss10_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_mo... | 26,073 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static uint64_t bonito_readl(void *opaque, target_phys_addr_t addr,
unsigned size)
{
PCIBonitoState *s = opaque;
uint32_t saddr;
saddr = (addr - BONITO_REGBASE) >> 2;
DPRINTF("bonito_readl "TARGET_FMT_plx"\n", addr);
switch (saddr) {
case BONITO_INTISR:
... | 26,074 |
FFmpeg | b7d77f8e64d5e30982671e861f63654709111a8e | 0 | static int ast_write_header(AVFormatContext *s)
{
ASTMuxContext *ast = s->priv_data;
AVIOContext *pb = s->pb;
AVCodecContext *enc;
unsigned int codec_tag;
if (s->nb_streams == 1) {
enc = s->streams[0]->codec;
} else {
av_log(s, AV_LOG_ERROR, "only one stream is support... | 26,076 |
FFmpeg | f67a0d115254461649470452058fa3c28c0df294 | 0 | static int read_old_huffman_tables(HYuvContext *s)
{
GetBitContext gb;
int i;
init_get_bits(&gb, classic_shift_luma,
classic_shift_luma_table_size * 8);
if (read_len_table(s->len[0], &gb) < 0)
return -1;
init_get_bits(&gb, classic_shift_chroma,
... | 26,077 |
qemu | 5f8632d3c3d7bc5ef24166ba7cf90fcfb2adbf7d | 1 | static void pc_init_isa(MachineState *machine)
{
has_pci_info = false;
has_acpi_build = false;
smbios_defaults = false;
if (!machine->cpu_model) {
machine->cpu_model = "486";
}
x86_cpu_compat_disable_kvm_features(FEAT_KVM, KVM_FEATURE_PV_EOI);
enable_compat_apic_id_mode... | 26,078 |
FFmpeg | 87e85a133f3ce2f037b90e9c7bbca99951df6c15 | 1 | static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics,
GetBitContext *gb)
{
const MPEG4AudioConfig *const m4ac = &ac->oc[1].m4ac;
const int aot = m4ac->object_type;
const int sampling_index = m4ac->sampling_index;
if (aot != AOT_ER_AAC_ELD) {
i... | 26,079 |
FFmpeg | 2867ed9b1c0561b0e50d9c4f73e09621333e2f1f | 1 | static void dvbsub_parse_region_segment(AVCodecContext *avctx,
uint8_t *buf, int buf_size)
{
DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
uint8_t *buf_end = buf + buf_size;
int region_id, object_id;
DVBSubRegion *region;
DVBSubObject *objec... | 26,080 |
FFmpeg | a04c2c707de2ce850f79870e84ac9d7ec7aa9143 | 1 | int ff_unlock_avcodec(const AVCodec *codec)
{
if (codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE || !codec->init)
return 0;
av_assert0(ff_avcodec_locked);
ff_avcodec_locked = 0;
atomic_fetch_add(&entangled_thread_counter, -1);
if (lockmgr_cb) {
if ((*lockmgr_cb)(&codec... | 26,081 |
FFmpeg | cf2b7c01f81c1fb3283a1390c0ca9a2f81f4f4a8 | 1 | static inline void copy(LZOContext *c, int cnt)
{
register const uint8_t *src = c->in;
register uint8_t *dst = c->out;
if (cnt > c->in_end - src) {
cnt = FFMAX(c->in_end - src, 0);
c->error |= AV_LZO_INPUT_DEPLETED;
}
if (cnt > c->out_end - dst) {
cnt ... | 26,082 |
FFmpeg | fd34dbea58e097609ff09cf7dcc59f74930195d3 | 1 | static int mxf_read_generic_descriptor(void *arg, AVIOContext *pb, int tag, int size, UID uid)
{
MXFDescriptor *descriptor = arg;
switch(tag) {
case 0x3F01:
descriptor->sub_descriptors_count = avio_rb32(pb);
if (descriptor->sub_descriptors_count >= UINT_MAX / sizeof(UID))
... | 26,083 |
FFmpeg | bd404e3949b081788247e2e6e9df0581ef7cc190 | 0 | static int fir_channel(AVFilterContext *ctx, void *arg, int ch, int nb_jobs)
{
AudioFIRContext *s = ctx->priv;
const float *src = (const float *)s->in[0]->extended_data[ch];
int index1 = (s->index + 1) % 3;
int index2 = (s->index + 2) % 3;
float *sum = s->sum[ch];
AVFrame *out = arg;
... | 26,084 |
FFmpeg | 763e714442e07f6430b003c8a9f4b62deaa7b3a5 | 0 | static int aiff_read_packet(AVFormatContext *s,
AVPacket *pkt)
{
AVStream *st = s->streams[0];
AIFFInputContext *aiff = s->priv_data;
int64_t max_size;
int res, size;
/* calculate size of remaining data */
max_size = aiff->data_end - avio_tell(s->pb);
i... | 26,085 |
FFmpeg | 8a048fe6f8bf41de93c091a7a9b3132bedc1b41c | 1 | static int get_riff(AVFormatContext *s, AVIOContext *pb)
{
AVIContext *avi = s->priv_data;
char header[8];
int i;
/* check RIFF header */
avio_read(pb, header, 4);
avi->riff_end = avio_rl32(pb); /* RIFF chunk size */
avi->riff_end += avio_tell(pb); /* RIFF chunk end */
avio_r... | 26,086 |
FFmpeg | 955db411929a9876d3cd016fbbb9c49b6362feba | 1 | static int decode_segment(TAKDecContext *s, int8_t mode, int32_t *decoded, int len)
{
struct CParam code;
GetBitContext *gb = &s->gb;
int i;
if (!mode) {
memset(decoded, 0, len * sizeof(*decoded));
return 0;
}
if (mode > FF_ARRAY_ELEMS(xcodes))
return AVERRO... | 26,088 |
FFmpeg | c4360559ee2a6c8c624f24fc7e2a1cf00972ba68 | 1 | static int paf_video_decode(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *pkt)
{
PAFVideoDecContext *c = avctx->priv_data;
uint8_t code, *dst, *end;
int i, frame, ret;
if (pkt->size < 2)
return AVERROR_INVALIDDATA;
bytestream2_init(&c->g... | 26,089 |
FFmpeg | 8821ae649e61097ec57ca58472c3e4239c82913c | 1 | int avresample_get_matrix(AVAudioResampleContext *avr, double *matrix,
int stride)
{
int in_channels, out_channels, i, o;
in_channels = av_get_channel_layout_nb_channels(avr->in_channel_layout);
out_channels = av_get_channel_layout_nb_channels(avr->out_channel_layout);
... | 26,091 |
FFmpeg | d584533cf38141172e20bae5436629ee17c8ce50 | 0 | static int parse_packet(AVFormatContext *s, AVPacket *pkt, int stream_index)
{
AVPacket out_pkt = { 0 }, flush_pkt = { 0 };
AVStream *st = s->streams[stream_index];
uint8_t *data = pkt ? pkt->data : NULL;
int size = pkt ? pkt->size : 0;
int ret = 0, got_output = 0;
if (!pkt) {
... | 26,092 |
FFmpeg | 5cb57a16ede71d913384a0b3036a2c6df5da5e43 | 1 | int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt,
uint8_t* buf, int buf_size, int64_t pos)
{
int size, i;
uint8_t *ppcm[4] = {0};
if (buf_size < DV_PROFILE_BYTES ||
!(c->sys = avpriv_dv_frame_profile(c->sys, buf, buf_size)) ||
buf_size < c->sys->fr... | 26,093 |
qemu | 6f2d8978728c48ca46f5c01835438508aace5c64 | 1 | int mmu40x_get_physical_address (CPUState *env, mmu_ctx_t *ctx,
target_ulong address, int rw, int access_type)
{
ppcemb_tlb_t *tlb;
target_phys_addr_t raddr;
int i, ret, zsel, zpr, pr;
ret = -1;
raddr = -1;
pr = msr_pr;
for (i = 0; i < env->nb_tlb;... | 26,094 |
qemu | c6d2283068026035a6468aae9dcde953bd7521ac | 1 | int bdrv_get_dirty(BlockDriverState *bs, int64_t sector)
{
int64_t chunk = sector / (int64_t)BDRV_SECTORS_PER_DIRTY_CHUNK;
if (bs->dirty_bitmap != NULL &&
(sector << BDRV_SECTOR_BITS) <= bdrv_getlength(bs)) {
return bs->dirty_bitmap[chunk];
} else {
return 0;
}
}
| 26,095 |
FFmpeg | cf5a6c754aa3b67062b8cc60fa244e9c7d82010f | 1 | static int gdv_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *avpkt)
{
GDVContext *gdv = avctx->priv_data;
GetByteContext *gb = &gdv->gb;
PutByteContext *pb = &gdv->pb;
AVFrame *frame = data;
int ret, i, pal_size;
const uint8_t *pal ... | 26,096 |
FFmpeg | 0afdedcafb4d524abfe2c958f17aafe4f1ab8d9a | 0 | int ff_rle_encode(uint8_t *outbuf, int out_size, const uint8_t *ptr , int bpp, int w,
int add_rep, int xor_rep, int add_raw, int xor_raw)
{
int count, x;
uint8_t *out = outbuf;
for(x = 0; x < w; x += count) {
/* see if we can encode the next set of pixels with RLE */
... | 26,097 |
FFmpeg | 4fd07b9366fb2f74b6af0dea8092d6bafa38f131 | 0 | static void stream_component_close(VideoState *is, int stream_index)
{
AVFormatContext *ic = is->ic;
AVCodecContext *avctx;
if (stream_index < 0 || stream_index >= ic->nb_streams)
return;
avctx = ic->streams[stream_index]->codec;
switch (avctx->codec_type) {
case AVMEDIA_TYPE... | 26,098 |
FFmpeg | 6d93307f8df81808f0dcdbc064b848054a6e83b3 | 1 | static inline int mpeg1_decode_block_inter(MpegEncContext *s, int16_t *block, int n)
{
int level, i, j, run;
RLTable *rl = &ff_rl_mpeg1;
uint8_t * const scantable = s->intra_scantable.permutated;
const uint16_t *quant_matrix = s->inter_matrix;
const int qscale = s->qscale;
... | 26,099 |
FFmpeg | ac4b32df71bd932838043a4838b86d11e169707f | 1 | static void vp8_decode_mv_mb_modes(AVCodecContext *avctx, VP8Frame *curframe,
VP8Frame *prev_frame)
{
VP8Context *s = avctx->priv_data;
int mb_x, mb_y;
s->mv_min.y = -MARGIN;
s->mv_max.y = ((s->mb_height - 1) << 6) + MARGIN;
for (mb_y = 0; mb_y < s->mb_hei... | 26,101 |
qemu | b45c03f585ea9bb1af76c73e82195418c294919d | 1 | static struct omap_eac_s *omap_eac_init(struct omap_target_agent_s *ta,
qemu_irq irq, qemu_irq *drq, omap_clk fclk, omap_clk iclk)
{
struct omap_eac_s *s = (struct omap_eac_s *)
g_malloc0(sizeof(struct omap_eac_s));
s->irq = irq;
s->codec.rxdrq = *drq ++;
s->codec.tx... | 26,102 |
qemu | df39076850958b842ac9e414dc3ab2895f1877bf | 1 | bool runstate_needs_reset(void)
{
return runstate_check(RUN_STATE_INTERNAL_ERROR) ||
runstate_check(RUN_STATE_SHUTDOWN) ||
runstate_check(RUN_STATE_GUEST_PANICKED);
}
| 26,103 |
qemu | 4a9c9ea0d318bec2f67848c5ceaf4ad5bcb91d09 | 1 | int64_t bdrv_getlength(BlockDriverState *bs)
{
int64_t ret = bdrv_nb_sectors(bs);
return ret < 0 ? ret : ret * BDRV_SECTOR_SIZE;
} | 26,104 |
FFmpeg | 68caef9d48c4f1540b1b3181ebe7062a3417c62a | 1 | static av_always_inline void mc_luma_scaled(VP9Context *s, vp9_scaled_mc_func smc,
vp9_mc_func (*mc)[2],
uint8_t *dst, ptrdiff_t dst_stride,
const uint8_t *ref, ptrdiff_t ref_stride,
... | 26,105 |
FFmpeg | c23acbaed40101c677dfcfbbfe0d2c230a8e8f44 | 1 | static void vc1_inv_trans_4x4_c(uint8_t *dest, int linesize, DCTELEM *block)
{
int i;
register int t1,t2,t3,t4;
DCTELEM *src, *dst;
const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
src = block;
dst = block;
for(i = 0; i < 4; i++){
t1 = 17 * (src[0] + src[2]) + 4;
t2... | 26,106 |
qemu | 016d2e1dfa21b64a524d3629fdd317d4c25bc3b8 | 1 | long do_rt_sigreturn(CPUSH4State *regs)
{
struct target_rt_sigframe *frame;
abi_ulong frame_addr;
sigset_t blocked;
target_ulong r0;
#if defined(DEBUG_SIGNAL)
fprintf(stderr, "do_rt_sigreturn\n");
#endif
frame_addr = regs->gregs[15];
if (!lock_user_struct(VERIFY_READ, frame, fram... | 26,107 |
FFmpeg | 24eac3cff54a5828ba76bc1ad93b99724cde45c1 | 1 | int ff_draw_init(FFDrawContext *draw, enum PixelFormat format, unsigned flags)
{
const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[format];
const AVComponentDescriptor *c;
unsigned i, nb_planes = 0;
int pixelstep[MAX_PLANES] = { 0 };
if (!desc->name)
return AVERROR(EINVAL);
... | 26,108 |
qemu | 7b3621f47a990c5099c6385728347f69a8d0e55c | 1 | static void pty_chr_close(struct CharDriverState *chr)
{
PtyCharDriver *s = chr->opaque;
int fd;
remove_fd_in_watch(chr);
fd = g_io_channel_unix_get_fd(s->fd);
g_io_channel_unref(s->fd);
close(fd);
if (s->timer_tag) {
g_source_remove(s->timer_tag);
s->timer_tag = ... | 26,109 |
FFmpeg | e0c6cce44729d94e2a5507a4b6d031f23e8bd7b6 | 0 | av_cold void ff_dct_init_mmx(DCTContext *s)
{
#if HAVE_YASM
int has_vectors = av_get_cpu_flags();
if (has_vectors & AV_CPU_FLAG_SSE && HAVE_SSE)
s->dct32 = ff_dct32_float_sse;
if (has_vectors & AV_CPU_FLAG_SSE2 && HAVE_SSE)
s->dct32 = ff_dct32_float_sse2;
if (has_vectors & AV_CPU... | 26,111 |
FFmpeg | 4a0f6651434c6f213d830140f575b4ec7858519f | 0 | int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame)
{
AVFrame *tmp;
int ret;
av_assert0(avctx->codec_type == AVMEDIA_TYPE_VIDEO);
if (!frame->data[0])
return ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF);
if (av_frame_is_writable(frame)) {
frame->pkt_pts = ... | 26,112 |
qemu | 32bafa8fdd098d52fbf1102d5a5e48d29398c0aa | 0 | static void block_dirty_bitmap_add_abort(BlkActionState *common)
{
BlockDirtyBitmapAdd *action;
BlockDirtyBitmapState *state = DO_UPCAST(BlockDirtyBitmapState,
common, common);
action = common->action->u.block_dirty_bitmap_add;
/* Should not be able t... | 26,115 |
qemu | 026aeffcb4752054830ba203020ed6eb05bcaba8 | 0 | static int cirrus_bitblt_common_patterncopy(CirrusVGAState *s, bool videosrc)
{
uint32_t patternsize;
uint8_t *dst;
uint8_t *src;
dst = s->vga.vram_ptr + s->cirrus_blt_dstaddr;
if (videosrc) {
switch (s->vga.get_bpp(&s->vga)) {
case 8:
patternsize = 64;
... | 26,116 |
qemu | 1a6245a5b0b4e8d822c739b403fc67c8a7bc8d12 | 0 | static int nbd_handle_export_name(NBDClient *client, uint32_t length)
{
int rc = -EINVAL, csock = client->sock;
char name[256];
/* Client sends:
[20 .. xx] export name (length bytes)
*/
TRACE("Checking length");
if (length > 255) {
LOG("Bad length received");
... | 26,119 |
qemu | eabb7b91b36b202b4dac2df2d59d698e3aff197a | 0 | static void tcg_out_insn_3401(TCGContext *s, AArch64Insn insn, TCGType ext,
TCGReg rd, TCGReg rn, uint64_t aimm)
{
if (aimm > 0xfff) {
assert((aimm & 0xfff) == 0);
aimm >>= 12;
assert(aimm <= 0xfff);
aimm |= 1 << 12; /* apply LSL 12 */
}
... | 26,120 |
qemu | 494a8ebe713055d3946183f4b395f85a18b43e9e | 0 | static int proxy_mkdir(FsContext *fs_ctx, V9fsPath *dir_path,
const char *name, FsCred *credp)
{
int retval;
V9fsString fullname;
v9fs_string_init(&fullname);
v9fs_string_sprintf(&fullname, "%s/%s", dir_path->data, name);
retval = v9fs_request(fs_ctx->private, T_MKD... | 26,121 |
qemu | e33e94f92298c96e0928cefab00ea5bae0a1cd19 | 0 | static always_inline uint64_t float_zero_divide_excp (uint64_t arg1, uint64_t arg2)
{
env->fpscr |= 1 << FPSCR_ZX;
env->fpscr &= ~((1 << FPSCR_FR) | (1 << FPSCR_FI));
/* Update the floating-point exception summary */
env->fpscr |= 1 << FPSCR_FX;
if (fpscr_ze != 0) {
/* Update the floa... | 26,123 |
qemu | 2c62f08ddbf3fa80dc7202eb9a2ea60ae44e2cc5 | 0 | void *s1d13745_init(qemu_irq gpio_int)
{
BlizzardState *s = (BlizzardState *) g_malloc0(sizeof(*s));
DisplaySurface *surface;
s->fb = g_malloc(0x180000);
s->con = graphic_console_init(blizzard_update_display,
blizzard_invalidate_display,
... | 26,124 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.