project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | 24fa90499f8b24bcba2960a3316d797f9b80b5e9 | 1 | void qemu_mutex_init(QemuMutex *mutex)
{
int err;
pthread_mutexattr_t mutexattr;
pthread_mutexattr_init(&mutexattr);
pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_ERRORCHECK);
err = pthread_mutex_init(&mutex->lock, &mutexattr);
pthread_mutexattr_destroy(&mutexattr);
if (err)
... | 11,452 |
FFmpeg | 7357ca900efcf829de4cce4cec6ddc286526d417 | 1 | static int old_codec47(SANMVideoContext *ctx, int top,
int left, int width, int height)
{
int i, j, seq, compr, new_rot, tbl_pos, skip;
int stride = ctx->pitch;
uint8_t *dst = ((uint8_t*)ctx->frm0) + left + top * stride;
uint8_t *prev1 = (uint8_t*)ctx->frm1;
uint8_t *pre... | 11,453 |
FFmpeg | d8245c3bcdd162891825a52cf55e4e8173d85a18 | 1 | static av_cold int cinvideo_decode_end(AVCodecContext *avctx)
{
CinVideoContext *cin = avctx->priv_data;
int i;
if (cin->frame.data[0])
avctx->release_buffer(avctx, &cin->frame);
for (i = 0; i < 3; ++i)
av_free(cin->bitmap_table[i]);
return 0;
}
| 11,454 |
qemu | f1f9e6c5961ffb36fd4a81cd7edcded7bfad2ab2 | 1 | static int vhost_virtqueue_start(struct vhost_dev *dev,
struct VirtIODevice *vdev,
struct vhost_virtqueue *vq,
unsigned idx)
{
BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(vdev)));
VirtioBusState *vbus = VIR... | 11,456 |
qemu | a79b5f8b80890b402fdb0733b0a073695a7875b5 | 1 | int qemu_v9fs_synth_add_file(V9fsSynthNode *parent, int mode,
const char *name, v9fs_synth_read read,
v9fs_synth_write write, void *arg)
{
int ret;
V9fsSynthNode *node, *tmp;
if (!v9fs_synth_fs) {
return EAGAIN;
}
if (!name... | 11,458 |
qemu | d9bce9d99f4656ae0b0127f7472db9067b8f84ab | 1 | PPC_OP(extsb)
{
T0 = (int32_t)((int8_t)(Ts0));
RETURN();
}
| 11,459 |
qemu | 5b61d5752156dcbbe2bf1366c877a676ed9f8f51 | 1 | static int qemu_rdma_broken_ipv6_kernel(Error **errp, struct ibv_context *verbs)
{
struct ibv_port_attr port_attr;
/* This bug only exists in linux, to our knowledge. */
#ifdef CONFIG_LINUX
/*
* Verbs are only NULL if management has bound to '[::]'.
*
* Let's iterate through all t... | 11,460 |
qemu | 4d7a81c06f5f17e019a2d3a18300500bd64f6f40 | 1 | static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid,
unsigned int epid, unsigned int streamid)
{
XHCIStreamContext *stctx;
XHCIEPContext *epctx;
XHCIRing *ring;
USBEndpoint *ep = NULL;
uint64_t mfindex;
int length;
int i;
trace_usb_xhci_ep_k... | 11,461 |
FFmpeg | 073c2593c9f0aa4445a6fc1b9b24e6e52a8cc2c1 | 1 | static int rv10_decode_init(AVCodecContext *avctx)
{
MpegEncContext *s = avctx->priv_data;
static int done=0;
MPV_decode_defaults(s);
s->avctx= avctx;
s->out_format = FMT_H263;
s->codec_id= avctx->codec_id;
s->width = avctx->width;
s->height = avctx->height;
swi... | 11,462 |
FFmpeg | 568e18b15e2ddf494fd8926707d34ca08c8edce5 | 1 | static uint64_t get_vb(ByteIOContext *bc){
uint64_t val=0;
int i= get_v(bc);
if(i>8)
return UINT64_MAX;
while(i--)
val = (val<<8) + get_byte(bc);
//av_log(NULL, AV_LOG_DEBUG, "get_vb()= %lld\n", val);
return val;
}
| 11,463 |
qemu | b4ba67d9a702507793c2724e56f98e9b0f7be02b | 1 | static void qvirtio_pci_virtqueue_kick(QVirtioDevice *d, QVirtQueue *vq)
{
QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d;
qpci_io_writew(dev->pdev, dev->addr + VIRTIO_PCI_QUEUE_NOTIFY, vq->index);
}
| 11,464 |
FFmpeg | 5439959ef013670d8974e88acb85bd03055a6229 | 1 | static av_always_inline void decode_bgr_1(HYuvContext *s, int count,
int decorrelate, int alpha)
{
int i;
OPEN_READER(re, &s->gb);
for (i = 0; i < count && get_bits_left(&s->gb) > 0; i++) {
unsigned int index;
int code, n;
UPDATE_... | 11,465 |
qemu | 4eae2a657d1ff5ada56eb9b4966eae0eff333b0b | 1 | static void virtio_balloon_receive_stats(VirtIODevice *vdev, VirtQueue *vq)
{
VirtIOBalloon *s = VIRTIO_BALLOON(vdev);
VirtQueueElement *elem;
VirtIOBalloonStat stat;
size_t offset = 0;
qemu_timeval tv;
s->stats_vq_elem = elem = virtqueue_pop(vq, sizeof(VirtQueueElement));
if (!ele... | 11,466 |
qemu | b1649fae49a899a222c3ac53c5009dd6f23349e1 | 1 | static int vmdk_write(BlockDriverState *bs, int64_t sector_num,
const uint8_t *buf, int nb_sectors)
{
BDRVVmdkState *s = bs->opaque;
VmdkExtent *extent = NULL;
int n, ret;
int64_t index_in_cluster;
uint64_t cluster_offset;
VmdkMetaData m_data;
if (sector_num >... | 11,467 |
FFmpeg | e0c6cce44729d94e2a5507a4b6d031f23e8bd7b6 | 0 | av_cold void ff_fft_init_mmx(FFTContext *s)
{
#if HAVE_YASM
int has_vectors = av_get_cpu_flags();
#if ARCH_X86_32
if (has_vectors & AV_CPU_FLAG_3DNOW && HAVE_AMD3DNOW) {
/* 3DNow! for K6-2/3 */
s->imdct_calc = ff_imdct_calc_3dnow;
s->imdct_half = ff_imdct_half_3dnow;
s->... | 11,470 |
FFmpeg | e45a2872fafe631c14aee9f79d0963d68c4fc1fd | 0 | void put_no_rnd_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
POWERPC_TBL_DECLARE(altivec_put_no_rnd_pixels8_xy2_num, 1);
#ifdef ALTIVEC_USE_REFERENCE_C_CODE
int j;
POWERPC_TBL_START_COUNT(altivec_put_no_rnd_pixels8_xy2_num, 1);
for (j = 0; j < 2; j++) {
int i;
... | 11,471 |
FFmpeg | a6191d098a03f94685ae4c072bfdf10afcd86223 | 0 | static void put_subframe_samples(DCAEncContext *c, int ss, int band, int ch)
{
if (c->abits[band][ch] <= 7) {
int sum, i, j;
for (i = 0; i < 8; i += 4) {
sum = 0;
for (j = 3; j >= 0; j--) {
sum *= ff_dca_quant_levels[c->abits[band][ch]];
... | 11,472 |
FFmpeg | ba30b74686f0cb6c9dd465ac4820059c48bf9d08 | 0 | static int sbr_make_f_master(AACContext *ac, SpectralBandReplication *sbr,
SpectrumParameters *spectrum)
{
unsigned int temp, max_qmf_subbands = 0;
unsigned int start_min, stop_min;
int k;
const int8_t *sbr_offset_ptr;
int16_t stop_dk[13];
if (sbr->sample_r... | 11,473 |
qemu | b5eff355460643d09e533024360fe0522f368c07 | 1 | BlockDriverAIOCB *bdrv_aio_write(BlockDriverState *bs, int64_t sector_num,
const uint8_t *buf, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque)
{
BlockDriver *drv = bs->drv;
BlockDriverAIOCB *ret;
if (!drv)
return... | 11,474 |
qemu | 85d604af5f96c32734af9974ec6ddb625b6716a2 | 1 | target_ulong helper_madd32_suov(CPUTriCoreState *env, target_ulong r1,
target_ulong r2, target_ulong r3)
{
uint64_t t1 = extract64(r1, 0, 32);
uint64_t t2 = extract64(r2, 0, 32);
uint64_t t3 = extract64(r3, 0, 32);
int64_t result;
result = t2 + (t1 * t3);
... | 11,475 |
qemu | c3e10c7b4377c1cbc0a4fbc12312c2cf41c0cda7 | 1 | void do_addmeo (void)
{
T1 = T0;
T0 += xer_ca + (-1);
if (likely(!((uint32_t)T1 &
((uint32_t)T1 ^ (uint32_t)T0) & (1UL << 31)))) {
xer_ov = 0;
} else {
xer_ov = 1;
xer_so = 1;
}
if (likely(T1 != 0))
xer_ca = 1;
}
| 11,476 |
qemu | 14a10fc39923b3af07c8c46d22cb20843bee3a72 | 1 | static void xtensa_cpu_realizefn(DeviceState *dev, Error **errp)
{
CPUState *cs = CPU(dev);
XtensaCPUClass *xcc = XTENSA_CPU_GET_CLASS(dev);
cs->gdb_num_regs = xcc->config->gdb_regmap.num_regs;
xcc->parent_realize(dev, errp);
} | 11,477 |
FFmpeg | 69e7ad8dbc9896aff70f1f1125c726764f28455f | 1 | static void mov_build_index(MOVContext *mov, AVStream *st)
{
MOVStreamContext *sc = st->priv_data;
int64_t current_offset;
int64_t current_dts = 0;
unsigned int stts_index = 0;
unsigned int stsc_index = 0;
unsigned int stss_index = 0;
unsigned int stps_index = 0;
unsigned int i,... | 11,478 |
FFmpeg | 79db7ac6ef235a06c3049d7792eda39da28ee3fd | 1 | int MPV_common_init(MpegEncContext *s)
{
int y_size, c_size, yc_size, i, mb_array_size, mv_table_size, x, y, threads;
s->mb_height = (s->height + 15) / 16;
if(s->avctx->thread_count > MAX_THREADS || (s->avctx->thread_count > s->mb_height && s->mb_height)){
av_log(s->avctx, AV_LOG_ERROR, "to... | 11,479 |
FFmpeg | 0ceca269b66ec12a23bf0907bd2c220513cdbf16 | 0 | static void read_const_block_data(ALSDecContext *ctx, ALSBlockData *bd)
{
ALSSpecificConfig *sconf = &ctx->sconf;
AVCodecContext *avctx = ctx->avctx;
GetBitContext *gb = &ctx->gb;
*bd->raw_samples = 0;
*bd->const_block = get_bits1(gb); // 1 = constant value, 0 = zero block (sile... | 11,480 |
FFmpeg | 2083648383d93917d482e69dd33e46cbd8404d31 | 0 | static int MP3lame_encode_frame(AVCodecContext *avctx,
unsigned char *frame, int buf_size, void *data)
{
Mp3AudioContext *s = avctx->priv_data;
int len;
int lame_result;
/* lame 3.91 dies on '1-channel interleaved' data */
if(data){
if (s->stereo) ... | 11,481 |
qemu | f8ed85ac992c48814d916d5df4d44f9a971c5de4 | 1 | static void lx_init(const LxBoardDesc *board, MachineState *machine)
{
#ifdef TARGET_WORDS_BIGENDIAN
int be = 1;
#else
int be = 0;
#endif
MemoryRegion *system_memory = get_system_memory();
XtensaCPU *cpu = NULL;
CPUXtensaState *env = NULL;
MemoryRegion *ram, *rom, *system_io;
Driv... | 11,482 |
qemu | 2af2a1b8d05a1a64c5005ed930137632b9d5aa22 | 1 | USBDevice *usb_bt_init(HCIInfo *hci)
{
USBDevice *dev;
struct USBBtState *s;
if (!hci)
dev = usb_create_simple(NULL /* FIXME */, "usb-bt-dongle");
s = DO_UPCAST(struct USBBtState, dev, dev);
s->dev.opaque = s;
s->hci = hci;
s->hci->opaque = s;
s->hci->evt_recv = usb... | 11,483 |
qemu | 95ce326e5b47b4b841849f8a2ac7b96d6e204dfb | 1 | static void term_up_char(void)
{
int idx;
if (term_hist_entry == 0)
return;
if (term_hist_entry == -1) {
/* Find latest entry */
for (idx = 0; idx < TERM_MAX_CMDS; idx++) {
if (term_history[idx] == NULL)
break;
}
term_hist_entry = idx;
}
term_hist_entry--;
if (term_hi... | 11,484 |
FFmpeg | 2f11aa141a01f97c5d2a015bd9dbdb27314b79c4 | 1 | static int vf_open(vf_instance_t *vf, char *args)
{
vf->config=config;
vf->query_format=query_format;
vf->put_image=put_image;
vf->uninit=uninit;
vf->priv = calloc(1, sizeof (struct vf_priv_s));
vf->priv->skipline = 0;
vf->priv->scalew = 1;
vf->... | 11,485 |
qemu | 4c1586787ff43c9acd18a56c12d720e3e6be9f7c | 1 | static void coroutine_fn v9fs_link(void *opaque)
{
V9fsPDU *pdu = opaque;
int32_t dfid, oldfid;
V9fsFidState *dfidp, *oldfidp;
V9fsString name;
size_t offset = 7;
int err = 0;
v9fs_string_init(&name);
err = pdu_unmarshal(pdu, offset, "dds", &dfid, &oldfid, &name);
if (err... | 11,486 |
qemu | efec3dd631d94160288392721a5f9c39e50fb2bc | 1 | static void port92_class_initfn(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
dc->no_user = 1;
dc->realize = port92_realizefn;
dc->reset = port92_reset;
dc->vmsd = &vmstate_port92_isa;
}
| 11,487 |
FFmpeg | 428098165de4c3edfe42c1b7f00627d287015863 | 1 | static inline int RENAME(yuv420_rgb15)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[]){
int y, h_size;
if(c->srcFormat == PIX_FMT_YUV422P){
srcStride[1] *= 2;
srcStride[2] *= 2;
}
h_size= (c->dstW+7)&~7;
if(h_s... | 11,489 |
qemu | d9bce9d99f4656ae0b0127f7472db9067b8f84ab | 1 | void OPPROTO op_subfco (void)
{
do_subfco();
RETURN();
}
| 11,490 |
qemu | 4e17eae9f2ee49833698aae2753c5bb041510870 | 1 | void tcg_target_qemu_prologue(TCGContext *s)
{
/* stmdb sp!, { r9 - r11, lr } */
tcg_out32(s, (COND_AL << 28) | 0x092d4e00);
tcg_out_bx(s, COND_AL, TCG_REG_R0);
tb_ret_addr = s->code_ptr;
/* ldmia sp!, { r9 - r11, pc } */
tcg_out32(s, (COND_AL << 28) | 0x08bd8e00);
}
| 11,491 |
qemu | 282ab04eb1e6f4faa6c5d2827e3209c4a1eec40e | 1 | static int scsi_disk_emulate_mode_sense(SCSIRequest *req, uint8_t *outbuf)
{
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, req->dev);
uint64_t nb_sectors;
int page, dbd, buflen;
uint8_t *p;
uint8_t dev_specific_param;
dbd = req->cmd.buf[1] & 0x8;
page = req->cmd.buf[2] & 0x3f;... | 11,493 |
qemu | b4ba67d9a702507793c2724e56f98e9b0f7be02b | 1 | void qpci_msix_enable(QPCIDevice *dev)
{
uint8_t addr;
uint16_t val;
uint32_t table;
uint8_t bir_table;
uint8_t bir_pba;
void *offset;
addr = qpci_find_capability(dev, PCI_CAP_ID_MSIX);
g_assert_cmphex(addr, !=, 0);
val = qpci_config_readw(dev, addr + PCI_MSIX_FLAGS);
... | 11,494 |
FFmpeg | 4b0e0f31bf0f618a634dcfdca45e72cdfb0b48b5 | 1 | av_cold void ff_lpc_end(LPCContext *s)
{
av_freep(&s->windowed_samples);
}
| 11,495 |
qemu | da5361cc685c004d8bb4e7c5e7b3a52c7aca2c56 | 1 | static void *handle_apdu_thread(void* arg)
{
EmulatedState *card = arg;
uint8_t recv_data[APDU_BUF_SIZE];
int recv_len;
VReaderStatus reader_status;
EmulEvent *event;
while (1) {
qemu_mutex_lock(&card->handle_apdu_mutex);
qemu_cond_wait(&card->handle_apdu_cond, &card->... | 11,496 |
FFmpeg | 2472dbc7a770a908a2f511ec337ec392ca3e3afa | 0 | static void write_codec_attr(AVStream *st, VariantStream *vs) {
int codec_strlen = strlen(vs->codec_attr);
char attr[32];
if (st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE)
return;
if (vs->attr_status == CODEC_ATTRIBUTE_WILL_NOT_BE_WRITTEN)
return;
if (st->codecpar->co... | 11,499 |
FFmpeg | e774c41cab765f5d12ecfb31e5fa30df41230de0 | 0 | static inline void update_rice(APERice *rice, int x)
{
rice->ksum += ((x + 1) / 2) - ((rice->ksum + 16) >> 5);
if (rice->k == 0)
rice->k = 1;
else if (rice->ksum < (1 << (rice->k + 4)))
rice->k--;
else if (rice->ksum >= (1 << (rice->k + 5)))
rice->k++;
}
| 11,500 |
FFmpeg | e8049af1325dd59a51546c15b2e71a0f578e9d27 | 1 | static void mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
{
MpegTSWrite *ts = s->priv_data;
uint8_t data[SECTION_LENGTH], *q, *desc_length_ptr, *program_info_length_ptr;
int val, stream_type, i;
q = data;
put16(&q, 0xe000 | service->pcr_pid);
program_info_length_ptr = q... | 11,502 |
qemu | 624cdd46d7f67fa2d23e87ffe0a36a569edde11a | 1 | static void vnc_init_basic_info_from_server_addr(QIOChannelSocket *ioc,
VncBasicInfo *info,
Error **errp)
{
SocketAddress *addr = NULL;
addr = qio_channel_socket_get_local_address(ioc, errp);
if (!addr) {
v... | 11,503 |
qemu | 2a32c6e82ed24d837ce7af346ffc93113f0164b5 | 1 | static void external_snapshot_prepare(BlkActionState *common,
Error **errp)
{
int flags = 0;
QDict *options = NULL;
Error *local_err = NULL;
/* Device and node name of the image to generate the snapshot from */
const char *device;
const char *node_na... | 11,505 |
qemu | aedbe19297907143f17b733a7ff0e0534377bed1 | 1 | void qemu_system_reset(bool report)
{
MachineClass *mc;
mc = current_machine ? MACHINE_GET_CLASS(current_machine) : NULL;
cpu_synchronize_all_states();
if (mc && mc->reset) {
mc->reset();
} else {
qemu_devices_reset();
}
if (report) {
qapi_event_send_... | 11,506 |
qemu | 7f0d763ce60fd0563cb71c85ae0f86ee71b7edcc | 1 | void DBDMA_register_channel(void *dbdma, int nchan, qemu_irq irq,
DBDMA_rw rw, DBDMA_flush flush,
void *opaque)
{
DBDMAState *s = dbdma;
DBDMA_channel *ch = &s->channels[nchan];
DBDMA_DPRINTF("DBDMA_register_channel 0x%x\n", nchan);
ch->... | 11,507 |
FFmpeg | fed92adbb3fc6cbf735e3df9a2f7d0a2917fcfbd | 1 | void vp78_decode_mv_mb_modes(AVCodecContext *avctx, VP8Frame *curframe,
VP8Frame *prev_frame, int is_vp7)
{
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-... | 11,508 |
FFmpeg | ab31b46b89362041a8e37cb0aac67cf3b53c2524 | 1 | static int read_high_coeffs(AVCodecContext *avctx, uint8_t *src, int16_t *dst, int size,
int c, int a, int d,
int width, ptrdiff_t stride)
{
PixletContext *ctx = avctx->priv_data;
GetBitContext *b = &ctx->gbit;
unsigned cnt1, shbits, rlen, nbits,... | 11,509 |
FFmpeg | d4b9974465baf893e90527a366e7a7411ded1ef8 | 1 | static void vc1_decode_i_blocks_adv(VC1Context *v)
{
int k;
MpegEncContext *s = &v->s;
int cbp, val;
uint8_t *coded_val;
int mb_pos;
int mquant = v->pq;
int mqdiff;
GetBitContext *gb = &s->gb;
/* select codingmode used for VLC tables selection */
switch(v->y_ac_table... | 11,510 |
FFmpeg | 5b4baf1506277863e9c1fa4bd302a4653e859669 | 1 | static int rtp_mpegts_write_header(AVFormatContext *s)
{
struct MuxChain *chain = s->priv_data;
AVFormatContext *mpegts_ctx = NULL, *rtp_ctx = NULL;
AVOutputFormat *mpegts_format = av_guess_format("mpegts", NULL, NULL);
AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL);
int i,... | 11,511 |
qemu | 6133b39f3c36623425a6ede9e89d93175fde15cd | 1 | void qemu_aio_coroutine_enter(AioContext *ctx, Coroutine *co)
{
Coroutine *self = qemu_coroutine_self();
CoroutineAction ret;
trace_qemu_aio_coroutine_enter(ctx, self, co, co->entry_arg);
if (co->caller) {
fprintf(stderr, "Co-routine re-entered recursively\n");
co->caller = self;
co->ctx... | 11,512 |
qemu | 454b580ae9ae3e7722f1cd5f6da7bb479f86bbd8 | 1 | static sPAPRDIMMState *spapr_recover_pending_dimm_state(sPAPRMachineState *ms,
PCDIMMDevice *dimm)
{
sPAPRDRConnector *drc;
PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm);
MemoryRegion *mr = ddc->get_memory_region(dimm);
uint64_t size = mem... | 11,513 |
qemu | 95ce326e5b47b4b841849f8a2ac7b96d6e204dfb | 1 | static void term_print_cmdline (const char *cmdline)
{
term_show_prompt();
term_printf(cmdline);
term_flush();
}
| 11,514 |
FFmpeg | 29f244e08ee0ef83098a65648b6880cb55a8c242 | 1 | static void dvbsub_parse_clut_segment(AVCodecContext *avctx,
const uint8_t *buf, int buf_size)
{
DVBSubContext *ctx = avctx->priv_data;
const uint8_t *buf_end = buf + buf_size;
int i, clut_id;
int version;
DVBSubCLUT *clut;
int entry_id, depth , ... | 11,515 |
qemu | 5c6c0e513600ba57c3e73b7151d3c0664438f7b5 | 1 | static SCSIGenericReq *scsi_find_request(SCSIGenericState *s, uint32_t tag)
{
return DO_UPCAST(SCSIGenericReq, req, scsi_req_find(&s->qdev, tag));
}
| 11,518 |
qemu | 85390939190e4b7eeba57765e344947c328cd166 | 1 | static void do_safe_dpy_refresh(CPUState *cpu, run_on_cpu_data opaque)
{
DisplayChangeListener *dcl = opaque.host_ptr;
dcl->ops->dpy_refresh(dcl);
} | 11,519 |
qemu | 3809951bf61605974b91578c582de4da28f8ed07 | 1 | void HELPER(exception_return)(CPUARMState *env)
{
int cur_el = arm_current_el(env);
unsigned int spsr_idx = aarch64_banked_spsr_index(cur_el);
uint32_t spsr = env->banked_spsr[spsr_idx];
int new_el;
aarch64_save_sp(env, cur_el);
env->exclusive_addr = -1;
/* We must squash the P... | 11,520 |
qemu | 81bad50ec40311797c38a7691844c7d2df9b3823 | 1 | target_ulong helper_evpe(CPUMIPSState *env)
{
CPUMIPSState *other_cpu = first_cpu;
target_ulong prev = env->mvp->CP0_MVPControl;
do {
if (other_cpu != env
/* If the VPE is WFI, don't disturb its sleep. */
&& !mips_vpe_is_wfi(other_cpu)) {
/* Enable the VP... | 11,521 |
qemu | 9b2fadda3e0196ffd485adde4fe9cdd6fae35300 | 1 | static void gen_tlbld_74xx(DisasContext *ctx)
{
#if defined(CONFIG_USER_ONLY)
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
#else
if (unlikely(ctx->pr)) {
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
return;
}
gen_helper_74xx_tlbd(cpu_env, cpu_gpr[rB(ctx->opcode)]);
#end... | 11,522 |
qemu | ca2edcd35cd1a8589dfa0533c19ff232fec7b4b5 | 1 | static void kvmclock_realize(DeviceState *dev, Error **errp)
{
KVMClockState *s = KVM_CLOCK(dev);
kvm_update_clock(s);
qemu_add_vm_change_state_handler(kvmclock_vm_state_change, s); | 11,523 |
FFmpeg | 3abde1a3b49cf299f2aae4eaae6b6cb5270bdc22 | 1 | static const uint8_t *pcx_rle_decode(const uint8_t *src, uint8_t *dst,
unsigned int bytes_per_scanline,
int compressed)
{
unsigned int i = 0;
unsigned char run, value;
if (compressed) {
while (i < bytes_per_scanline) ... | 11,525 |
FFmpeg | f467fc02b475cd45b68aa5fb5f7c78286110ba86 | 0 | void checkasm_check_h264pred(void)
{
static const struct {
void (*func)(H264PredContext*, uint8_t*, uint8_t*, int, int, int);
const char *name;
} tests[] = {
{ check_pred4x4, "pred4x4" },
{ check_pred8x8, "pred8x8" },
{ check_pred16x16, "pred16x16" },
... | 11,526 |
FFmpeg | 053e80f6eaf8d87521fe58ea96886b6ee0bbe59d | 1 | static int mov_read_ctts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
MOVStreamContext *sc;
unsigned int i, entries;
if (c->fc->nb_streams < 1)
return 0;
st = c->fc->streams[c->fc->nb_streams-1];
sc = st->priv_data;
avio_r8(pb); /* version */
avio_r... | 11,530 |
qemu | 47f9f15831faa549504ab9b035aaea44a02e5f95 | 1 | static ssize_t nc_sendv_compat(NetClientState *nc, const struct iovec *iov,
int iovcnt, unsigned flags)
{
uint8_t *buf = NULL;
uint8_t *buffer;
size_t offset;
ssize_t ret;
if (iovcnt == 1) {
buffer = iov[0].iov_base;
offset = iov[0].iov_len;
... | 11,531 |
qemu | 187337f8b0ec0813dd3876d1efe37d415fb81c2e | 1 | qemu_irq *arm_gic_init(uint32_t base, qemu_irq parent_irq)
{
gic_state *s;
qemu_irq *qi;
int iomemtype;
s = (gic_state *)qemu_mallocz(sizeof(gic_state));
if (!s)
return NULL;
qi = qemu_allocate_irqs(gic_set_irq, s, GIC_NIRQ);
s->parent_irq = parent_irq;
if (base != 0x... | 11,532 |
qemu | 6f745bdaac26bcbdd7e2ffa2a6ea29aabbbc54e1 | 1 | static int qcow_create2(const char *filename, int64_t total_size,
const char *backing_file, const char *backing_format,
int flags, size_t cluster_size, int prealloc)
{
int fd, header_size, backing_filename_len, l1_size, i, shift, l2_bits;
int ref_clusters, ... | 11,533 |
FFmpeg | c341f734e5f9d6af4a8fdcceb6f5d12de6395c76 | 1 | static void chroma_4mv_motion(MpegEncContext *s,
uint8_t *dest_cb, uint8_t *dest_cr,
uint8_t **ref_picture,
op_pixels_func *pix_op,
int mx, int my)
{
int dxy, emu=0, src_x, src_y, offset;
... | 11,534 |
FFmpeg | b2bcbcd99967c7cb9f17ae07c48c32baf8855e40 | 0 | static void super2xsai(AVFilterContext *ctx,
uint8_t *src, int src_linesize,
uint8_t *dst, int dst_linesize,
int width, int height)
{
Super2xSaIContext *sai = ctx->priv;
unsigned int x, y;
uint32_t color[4][4];
unsigned char *s... | 11,536 |
FFmpeg | f929ab0569ff31ed5a59b0b0adb7ce09df3fca39 | 0 | static inline int pic_is_unused(MpegEncContext *s, Picture *pic)
{
if (pic->f->buf[0] == NULL)
return 1;
if (pic->needs_realloc && !(pic->reference & DELAYED_PIC_REF))
return 1;
return 0;
}
| 11,537 |
FFmpeg | 866c44d4b0f90d448cffbe9d4422a2dec7df698b | 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->extra_sc... | 11,538 |
FFmpeg | 5871adc90f8c1037535563e33ebeaf032bb4d5d6 | 1 | void ff_cavs_mv(AVSContext *h, enum cavs_mv_loc nP, enum cavs_mv_loc nC,
enum cavs_mv_pred mode, enum cavs_block size, int ref)
{
cavs_vector *mvP = &h->mv[nP];
cavs_vector *mvA = &h->mv[nP-1];
cavs_vector *mvB = &h->mv[nP-4];
cavs_vector *mvC = &h->mv[nC];
const cavs_vector *... | 11,539 |
qemu | 4f4321c11ff6e98583846bfd6f0e81954924b003 | 1 | static int usbredir_handle_iso_data(USBRedirDevice *dev, USBPacket *p,
uint8_t ep)
{
int status, len;
if (!dev->endpoint[EP2I(ep)].iso_started &&
!dev->endpoint[EP2I(ep)].iso_error) {
struct usb_redir_start_iso_stream_header start_iso = {
... | 11,540 |
qemu | eb2f9b024d68884a3b25e63e4dbf90b67f8da236 | 1 | static inline void vmsvga_check_size(struct vmsvga_state_s *s)
{
DisplaySurface *surface = qemu_console_surface(s->vga.con);
if (s->new_width != surface_width(surface) ||
s->new_height != surface_height(surface)) {
qemu_console_resize(s->vga.con, s->new_width, s->new_height);
s->... | 11,541 |
qemu | 848696bf353750899832c51005f1bd3540da5c29 | 1 | void vga_init(VGACommonState *s, Object *obj, MemoryRegion *address_space,
MemoryRegion *address_space_io, bool init_vga_ports)
{
MemoryRegion *vga_io_memory;
const MemoryRegionPortio *vga_ports, *vbe_ports;
PortioList *vga_port_list = g_new(PortioList, 1);
PortioList *vbe_port_list ... | 11,542 |
qemu | ae392c416c69a020226c768d9c3af08b29dd6d96 | 1 | static void msix_mmio_write(void *opaque, target_phys_addr_t addr,
uint64_t val, unsigned size)
{
PCIDevice *dev = opaque;
unsigned int offset = addr & (MSIX_PAGE_SIZE - 1) & ~0x3;
int vector = offset / PCI_MSIX_ENTRY_SIZE;
/* MSI-X page includes a read-only PBA and a... | 11,544 |
qemu | 2cdff7f620ebd3b5246cf0c0d1f6fa0eededa4ca | 1 | static void qemu_laio_completion_cb(EventNotifier *e)
{
struct qemu_laio_state *s = container_of(e, struct qemu_laio_state, e);
while (event_notifier_test_and_clear(&s->e)) {
struct io_event events[MAX_EVENTS];
struct timespec ts = { 0 };
int nevents, i;
do {
... | 11,545 |
qemu | 3d0db3e74d818ba43c62cdfb3220e551f4f5ae37 | 1 | static void spapr_rng_class_init(ObjectClass *oc, void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
dc->realize = spapr_rng_realize;
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
dc->props = spapr_rng_properties;
} | 11,547 |
qemu | e8199e4895d34136735dea7e628d0de1a5afb630 | 1 | static void process_incoming_migration_co(void *opaque)
{
QEMUFile *f = opaque;
MigrationIncomingState *mis = migration_incoming_get_current();
PostcopyState ps;
int ret;
mis->from_src_file = f;
mis->largest_page_size = qemu_ram_pagesize_largest();
postcopy_state_set(POSTCOPY_INCOM... | 11,548 |
FFmpeg | 9959a52b14bcfa3e5baeb3fc8a86c04bbc0d3d5d | 1 | static int ast_read_packet(AVFormatContext *s, AVPacket *pkt)
{
uint32_t type, size;
int64_t pos;
int ret;
if (avio_feof(s->pb))
return AVERROR_EOF;
pos = avio_tell(s->pb);
type = avio_rl32(s->pb);
size = avio_rb32(s->pb);
if (size > INT_MAX / s->streams[0]->codecp... | 11,550 |
FFmpeg | f3fdef108eb06b1e71b29152bf6822519e787efe | 1 | static void do_apply_filter(APEContext *ctx, int version, APEFilter *f,
int32_t *data, int count, int order, int fracbits)
{
int res;
int absres;
while (count--) {
/* round fixedpoint scalar product */
res = ctx->adsp.scalarproduct_and_madd_int16(f->coeff... | 11,551 |
FFmpeg | e6c90ce94f1b07f50cea2babf7471af455cca0ff | 0 | static int fill_filter_caches(H264Context *h, H264SliceContext *sl, int mb_type)
{
const int mb_xy = h->mb_xy;
int top_xy, left_xy[LEFT_MBS];
int top_type, left_type[LEFT_MBS];
uint8_t *nnz;
uint8_t *nnz_cache;
top_xy = mb_xy - (h->mb_stride << MB_FIELD(h));
/* Wow, what a mess, ... | 11,552 |
FFmpeg | d68c05380cebf563915412182643a8be04ef890b | 0 | av_cold void ff_init_lls_x86(LLSModel *m)
{
int cpu_flags = av_get_cpu_flags();
if (EXTERNAL_SSE2(cpu_flags)) {
m->update_lls = ff_update_lls_sse2;
if (m->indep_count >= 4)
m->evaluate_lls = ff_evaluate_lls_sse2;
}
if (EXTERNAL_AVX(cpu_flags)) {
m->update_lls... | 11,554 |
FFmpeg | 8b2fce0d3f5a56c40c28899c9237210ca8f9cf75 | 1 | static inline void RENAME(yuv2yuvX)(SwsContext *c, int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
uint8_t *dest, uint8_t *uDest, uint8_t *vDest, long dstW, long chrDstW)
{
#ifde... | 11,555 |
qemu | c508277335e3b6b20cf18e6ea3a35c1fa835c64a | 1 | static void vmxnet3_update_rx_mode(VMXNET3State *s)
{
s->rx_mode = VMXNET3_READ_DRV_SHARED32(s->drv_shmem,
devRead.rxFilterConf.rxMode);
VMW_CFPRN("RX mode: 0x%08X", s->rx_mode);
}
| 11,556 |
qemu | c63807244fb55071675907460a0ecf228c1766c8 | 1 | static int qemu_peek_byte(QEMUFile *f)
{
if (f->is_write) {
abort();
}
if (f->buf_index >= f->buf_size) {
qemu_fill_buffer(f);
if (f->buf_index >= f->buf_size) {
return 0;
}
}
return f->buf[f->buf_index];
}
| 11,557 |
qemu | 590fe5722b522e492a9c78adadae4def35b137dd | 1 | static int virtio_ccw_set_vqs(SubchDev *sch, uint64_t addr, uint32_t align,
uint16_t index, uint16_t num)
{
VirtIODevice *vdev = virtio_ccw_get_vdev(sch);
if (index > VIRTIO_PCI_QUEUE_MAX) {
return -EINVAL;
}
/* Current code in virtio.c relies on 4K align... | 11,558 |
qemu | ed3d807b0a577c4f825b25f3281fe54ce89202db | 1 | static bool cuda_cmd_set_time(CUDAState *s,
const uint8_t *in_data, int in_len,
uint8_t *out_data, int *out_len)
{
uint32_t ti;
if (in_len != 4) {
return false;
}
ti = (((uint32_t)in_data[1]) << 24) + (((uint32_t)in_data[2])... | 11,559 |
qemu | 5c6c0e513600ba57c3e73b7151d3c0664438f7b5 | 1 | static void vscsi_send_request_sense(VSCSIState *s, vscsi_req *req)
{
SCSIDevice *sdev = req->sdev;
uint8_t *cdb = req->iu.srp.cmd.cdb;
int n;
cdb[0] = 3;
cdb[1] = 0;
cdb[2] = 0;
cdb[3] = 0;
cdb[4] = 96;
cdb[5] = 0;
req->sensing = 1;
n = sdev->info->send_command... | 11,560 |
FFmpeg | 6e42e6c4b410dbef8b593c2d796a5dad95f89ee4 | 1 | static inline void RENAME(yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst,
long width, long height,
long lumStride, long chromStride, long dstStride)
{
//FIXME interpolate chroma
RENAME(yuvPlanartouyvy)(ysrc, usrc, vsrc, dst, width, height, lumStride, chromStride, dstStr... | 11,561 |
qemu | 7e09797c299712cafa7bc05dd57c1b13afcc6039 | 1 | static uint64_t pmsav5_data_ap_read(CPUARMState *env, const ARMCPRegInfo *ri)
{
return simple_mpu_ap_bits(env->cp15.c5_data);
}
| 11,562 |
FFmpeg | 5b349c8d7cc5dd26b3fbbce6e3883ce02861eeb7 | 0 | static void flat(WaveformContext *s, AVFrame *in, AVFrame *out,
int component, int intensity, int offset, int column)
{
const int plane = s->desc->comp[component].plane;
const int mirror = s->mirror;
const int c0_linesize = in->linesize[ plane + 0 ];
const int c1_linesize = in->li... | 11,563 |
FFmpeg | f30a7d9861af884f352ec2484820a75d79a4e0e2 | 0 | av_cold int ff_mpv_common_init(MpegEncContext *s)
{
int i;
int nb_slices = (HAVE_THREADS &&
s->avctx->active_thread_type & FF_THREAD_SLICE) ?
s->avctx->thread_count : 1;
if (s->encoding && s->avctx->slices)
nb_slices = s->avctx->slices;
if (s-... | 11,564 |
FFmpeg | 94d05ff15985d17aba070eaec82acd21c0da3d86 | 1 | static int read_audio_mux_element(struct LATMContext *latmctx,
GetBitContext *gb)
{
int err;
uint8_t use_same_mux = get_bits(gb, 1);
if (!use_same_mux) {
if ((err = read_stream_mux_config(latmctx, gb)) < 0)
return err;
} else if (!latmctx->aa... | 11,565 |
qemu | 0d4cc3e715f5794077895345577725539afe81eb | 1 | static int vpc_has_zero_init(BlockDriverState *bs)
{
BDRVVPCState *s = bs->opaque;
VHDFooter *footer = (VHDFooter *) s->footer_buf;
if (cpu_to_be32(footer->type) == VHD_FIXED) {
return bdrv_has_zero_init(bs->file);
} else {
return 1;
}
}
| 11,567 |
FFmpeg | c0ece1f4addf8ac31df95775a2d36be2a55fc759 | 1 | static int mpeg_decode_postinit(AVCodecContext *avctx)
{
Mpeg1Context *s1 = avctx->priv_data;
MpegEncContext *s = &s1->mpeg_enc_ctx;
uint8_t old_permutation[64];
int ret;
if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO) {
// MPEG-1 aspect
avctx->sample_aspect_ratio = av_d2q(... | 11,568 |
FFmpeg | e3ba817b95bbdc7c8aaf83b4a6804d1b49eb4de4 | 1 | static void mxf_write_index_table_segment(AVFormatContext *s)
{
MXFContext *mxf = s->priv_data;
AVIOContext *pb = s->pb;
int i, j, temporal_reordering = 0;
int key_index = mxf->last_key_index;
av_log(s, AV_LOG_DEBUG, "edit units count %d\n", mxf->edit_units_count);
if (!mxf->edit_unit... | 11,569 |
FFmpeg | 3176217c60ca7828712985092d9102d331ea4f3d | 0 | static int vaapi_h264_decode_slice(AVCodecContext *avctx,
const uint8_t *buffer,
uint32_t size)
{
H264Context * const h = avctx->priv_data;
H264SliceContext *sl = &h->slice_ctx[0];
VASliceParameterBufferH264 *slice_param;
... | 11,571 |
FFmpeg | 17a70fdeeff1260ac9b2651ea9f36dbd23d0ced8 | 0 | static void adaptive_quantization(MpegEncContext *s, double q){
int i;
const float lumi_masking= s->avctx->lumi_masking / (128.0*128.0);
const float dark_masking= s->avctx->dark_masking / (128.0*128.0);
const float temp_cplx_masking= s->avctx->temporal_cplx_masking;
const float spatial_cplx_mas... | 11,572 |
FFmpeg | b3eb4f54c0d091ed518b38a5b90183d0d55fa729 | 0 | static int flashsv2_prime(FlashSVContext *s, uint8_t *src,
int size, int unp_size)
{
z_stream zs;
int zret; // Zlib return code
zs.zalloc = NULL;
zs.zfree = NULL;
zs.opaque = NULL;
s->zstream.next_in = src;
s->zstream.avail_in = size;
s->zstrea... | 11,573 |
FFmpeg | 05f4703a168a336363750e32bcfdd6f303fbdbc3 | 0 | int ff_mpeg4_decode_video_packet_header(Mpeg4DecContext *ctx)
{
MpegEncContext *s = &ctx->m;
int mb_num_bits = av_log2(s->mb_num - 1) + 1;
int header_extension = 0, mb_num, len;
/* is there enough space left for a video packet + header */
if (get_bits_count(&s->gb) > s->gb.size_in_bit... | 11,574 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.